SORU
30 Ocak 2011, Pazar


çalışma sayfa yüklendiğinde fonksiyonu

Sayfa yüklendiğinde bir işlevi çalıştırmak istiyorum ama body etiketini kullanmak istemiyorum.

Eğer vücut böyle ben yeniden eğer çalışan bir komut dosyası var:

function codeAddress() {
 code.....
}

<body onLoad="codeAddress()">

Ama vücut 9 ** ve bir sürü uğraş var olmadan çalıştırmak, Bu örnek vermek istiyorum:

window.onload = codeAddress;

ama çalışmıyor?

Nasıl sayfa yüklendiğinde çalıştırmak mı?

CEVAP
30 Ocak 2011, Pazar


window.onload = codeAddress; - here's a demo ve tam kodu olmalı

<!DOCTYPE html>
<html>
    <head>
        <title>Test</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <script type="text/javascript">
        function codeAddress() {
            alert('ok');
        }
        window.onload = codeAddress;
        </script>
    </head>
    <body>
    
    </body>
</html>


<!DOCTYPE html>
<html>
    <head>
        <title>Test</title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <script type="text/javascript">
        function codeAddress() {
            alert('ok');
        }
        
        </script>
    </head>
    <body onload="codeAddress();">
    
    </body>
</html>

Bunu Paylaş:
  • Google+
  • E-Posta
Etiketler:

YORUMLAR

SPONSOR VİDEO

Rastgele Yazarlar

  • infodirt

    infodirt

    11 Mart 2009
  • MaximumPCMag

    MaximumPCMag

    23 Temmuz 2010
  • VOICE TV

    VOICE TV

    2 Aralık 2010