PDA

View Full Version : linking to javascript




sonofslim
Jul 6, 2004, 09:26 AM
when you're referring to external javascript files, is there any benefit to this:<script src="foo.js" type="text/javascript" /> over this?<script src="foo.js" type="text/javascript"></script>

because both validate, but the former makes certain browsers (*cough* IE5/Mac *cough*) totally soil themselves. is there any reason i wouldn't want to use the second format?



jeremy.king
Jul 6, 2004, 09:55 AM
Since all browsers don't fully support XHTML (i.e. some browsers don't support self closing tags like in your example), just use the latter and they should be happy.