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

  • psidot

    psidot

    2 Kasım 2006
  • The Computer Chronicles

    The Computer

    7 Kasım 2012
  • TV and Lust

    TV and Lust

    26 HAZİRAN 2006