2010-06-22 4 views

답변

2
<html> 
<head> 
<script...> 
    function helloWorld() { 
     alert('Hello world!'); 
    } 
</script> 
</head> 
<body> 
...some content... 
    <script...> 
     helloWorld(); 
    </script> 
</body> 
</html> 
+0

고마워요 !!!!!!! – Lalchand

3

당신은 다음과 같이 거기에 <script> 블록을 배치 할 수 있습니다 :

<script type="text/javascript"> 
    myFunction(); 
    </script> 
</body> 

을 또한, 당신은 어떤 종류의 프레임 워크를 사용하는 경우, 그들의 대부분은 DOM이 때 핸들러가 상황에 가장 적합한 것이면 window.onload을 사용할 수 있습니다.

관련 문제