开发者

javascript inline script doesn't work after jquery import from cdn

I've got the following code:

<code><html>
<body><br>
<script type="t开发者_JAVA技巧ext/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js" />

<script type="text/javascript">

alert("debug");

</script>

</body>

</html>

And i don't know why the second script isn't loaded. I've also tried:

<html>
<body><br>
<script type="text/javascript" src="jquery.js" />

<script type="text/javascript">

  alert("debug");

</script>

</body>

 </html>


Try

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

instead of

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

See a related posting on SO

Why don’t self-closing script tags work?


You shouldn't use self-closing <script> tags in HTML documents, they will break in IE. Try

<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js">
</script>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜