2012-06-13 4 views
0

현재 모든 자바 스크립트 코드가있는 html 파일이 있습니다. 별도의 .js 파일을 만들고, 그 안에 모든 자바 스크립트 코드를 넣고 그것을 .html 파일에 포함시키고 싶습니다. 이 작동하지 않는 경우,포함 할 별도의 js 파일을 만듭니다.

<script type='text/javascript' src="myfile.js"></script> 

을하지만 - 나는 그 일을 시도하고, 또한의 .js 파일에 열기/닫기 태그를 제거하고 .html 파일에이 줄을 넣어. 무엇이 잘못되었는지에 대한 아이디어가 있습니까? 미리 감사드립니다.

--------------------- EDIT ------------------------ -----

<html> 

<title>Process Details</title> 

<head> 
<script type="text/javascript" src="https://www.google.com/jsapi"></script> 
<script type="text/javascript" src="myfile.js"> 
</script> 

<style type="text/css"> 
    body { font-size: 80%; font-family: 'Lucida Grande', Verdana, Arial, Sans-Serif; } 
    ul#tabs { list-style-type: none; margin: 30px 0 0 0; padding: 0 0 0.3em 0; } 
    ul#tabs li { display: inline; } 
    ul#tabs li a { color: #42454a; background-color: #dedbde; border: 1px solid #c9c3ba; border-bottom: none; padding: 0.3em; text-decoration: none; } 
    ul#tabs li a:hover { background-color: #f1f0ee; } 
    ul#tabs li a.selected { color: #000; background-color: #f1f0ee; font-weight: bold; padding: 0.7em 0.3em 0.38em 0.3em; } 
    div.tabContent { border: 1px solid #c9c3ba; padding: 0.5em; background-color: #f1f0ee; } 
    div.tabContent.hide { display: none; } 
    .heading { font-size:110%; font-family:'Century Schoolbook'; color: maroon; } 
    .data { font-size:110%; font-family:'Century Schoolbook'; color:black; } 
</style> 

</head> 

<body onload="init()"> 
<center> 
<font face='Calibri' size='3' color='Blue'>PID : </font> 
<select id='list' onchange="refreshData()"> 
</select> 
<form> 
<input type="button" id="Refresh" onclick="refreshPage()" value="Refresh Data"/> 
</form> 
</center> 

<ul id="tabs"> 
<li><a href="#memory">Memory</a></li> 
<li><a href="#thread">Thread</a></li> 
<li><a href="#summary">Summary</a></li> 
</ul> 
<div class="tabContent" id="memory"> 
<table id="graphtab" align="center"> 

<tr> 
<td id="heap" align="center"></td> 
<td id="nonheap" align="center"></td> 
</tr> 
<tr> 
<td id="resident" align="center"></td> 
<td id="pagefaults" align="center"></td> 
</tr> 

</table> 
</div> 
<div class="tabContent" id="thread"> 
<table id="threadtab" align="center"> 

<tr> 
<td id="cpuusage" align="center"></td> 
<td id="count" align="center"></td> 
</tr> 
<tr> 
<td id="threadlist" align="center"></td> 
<td id="threaddets" align="center"></td> 
</tr> 

</table> 
</div> 
<div class="tabContent" id="summary"> 
</div> 
<a href="client.html">Home Page</a> 
</body> 

</html> 
+0

우리와 공유 한 코드에는 아무런 문제가 없습니다. – Quentin

+0

아직도 작동하지 않습니다. 페이지가로드 될 때 아무 일도 일어나지 않습니다. – Cygnus

+0

문제가 무엇이든간에, 우리는 당신이 우리와 공유 한 것에서 그것을 신성하게 할 수 없습니다. – Quentin

답변

1

사용 http 프로토콜 대신 https. https를 사용하면 크롬에서 GET 예외가 throw되지만,이 아닙니다.

그리고 <title><head> 태그 안에 있어야합니다.

+0

고마워요. !! !! 나는 변화를 만들었다 :) – Cygnus