RobberBaron Posted February 16, 2010 Share Posted February 16, 2010 Files with the extension .js are real JavaScript files, so if you typed 'alert("Hi!")' and ran the file it would give the error "Line 1: Expression Expected". So when we link it with HTML (<script src="file.js">) does it really make a difference with the file type? I was making my own version of ASP written with JavaScript, and it would be useful to do <script src="file.asp">. So is this possible? Link to comment Share on other sites More sharing options...
Ingolme Posted February 16, 2010 Share Posted February 16, 2010 The extension doesn't matter because you use the type attribute to tell the browser what kind of script it should be ready to parse: <script type="text/javascript" src="file.ext"></script> Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.