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

  • boogie2988

    boogie2988

    6 NİSAN 2006
  • JorteexHD

    JorteexHD

    20 NİSAN 2012
  • Julian Smith

    Julian Smith

    31 EKİM 2006