tags:

views:

29

answers:

2

Hi stackers, I've got the following code:

<code><html>
<body><br>
<script type="text/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>
+3  A: 

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"&gt;
</script>
Pekka
you're right, they break even in firefox
altvali
+3  A: 

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?

rahul
wow i can't believe how simple this was
altvali