I have a doubt regarding this writing this below statement Here i didn’t mentioned the type in the Second Statement.But still am getting the jquery or $ symbol.Cud any explain me ?Here i am using VS 2010………………………………………. The first one specifies the MIME type explicitly. Your browser may be reading the file as Javascript by default. But doing this …
via Asp.Net Developed Tutorials » Search Results » ajax:
Difference between these two things
I have a doubt regarding this writing this below statement
Here i didn't mentioned the type in the Second Statement.But still am getting the jquery or $ symbol.Cud any explain me ?
Here i am using VS 2010.
.............................................
The first one specifies the MIME type explicitly. Your browser may be reading the file as Javascript by default. But doing this could be wrong. Especially in browsers which support multiple scripting language for ex vbscript.
MIME_type - Some values:
text/javascript
text/ecmascript
application/ecmascript
application/javascript
text/vbscriptNote: According to IANA, the "text/javascript" MIME type is obsolete. The new standard is "application/javascript". However, "application/javascript" is not supported by Internet Explorer.
http://www.w3schools.com/tags/att_script_type.asp
.............................................
Browsers have, for many years, assumed that a script will be JavaScript unless the type attribute says otherwise. The HTML5 draft makes this explicit.
Note that the use of XML-style self closing tags is:
OK in XHTML 1.0/1.1 (but leaving the type attribute off is not)
NOT OK in HTML-Compatible XHTML 1.0 (which you need to use if you want IE8 and lower to work)
NOT OK in HTML 4.01
NOT OK in HTML5
If you are writing HTML 4.01 (which is a sensible idea for most sites as it has mature QA tools) then you should be writing:
src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js">
If you are writing XHTML 1.0 and jumping through the hoops needed to supply it to Internet Explorer 8 and lower, then you should be using the same syntax for script elements as HTML 4.01.
If you are writing HTML5, then you may omit the type attribute, but the explicit end tag is still required.
.............................................
The browser will try to see what "type" or "language" the script is. But the first one is the better one.
.............................................
When no type attribute is specified in a script tag, the type value is by default "text/javascript" per HTML 5 specification.
As per Client-side JavaScript
For more info: Difference between these two things
Asp.Net Developed Tutorials » Search Results » ajax