Possible Duplicate:
Why don’t self-closing script tags work?
I had this bit of javascript code inside a <head> element.
<script src="jquery-1.3.2.js" type="text/javascript" />
<script type="text/javascript">
$(document).ready(function() {
$("#welcome").addClass("centered");
$("#created").addClass("centered");
});
</script>
Which refused to work until I used an explicit end script element:
<script src="jquery-1.3.2.js" type="text/javascript"></script>
Why is there a difference?
EDIT: the entire header was:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<link rel="stylesheet" href="css/blueprint/screen.css" type="text/css" media="screen, projection" />
<link rel="stylesheet" href="css/blueprint/print.css" type="text/css" media="print" />
<!--[if lt IE 8]><link rel="stylesheet" href="css/blueprint/ie.css" type="text/css" media="screen, projection" /><![endif]-->
<link rel="stylesheet" href="css/blueprint/src/typography.css" />
<link rel="stylesheet" href="css/common.css" />
<script src="jquery-1.3.2.js" type="text/javascript" />
<script type="text/javascript">
$(document).ready(function() {
$("#welcome").addClass("centered");
$("#created").addClass("centered");
});
</script>
</head>
I don't understand why the script element needs an explicit end element but the link element doesnt.