Reputation: 77
What will happen if I load script tag with incorrect type. For example,
<script type="image/png" src="index.html" />
Will I receive content of index.html page? Will I get any error from browser? My main concern is can I use such incorrect tag in dynamic way to communicate with index.html page?
Upvotes: 0
Views: 178
Reputation: 1948
It is invalid syntax, you are merging three different type of properties together.
Neither this will work nor throw error.
Upvotes: 0
Reputation: 83006
According to HTML5, behaviour is browser dependent, because the list of supported script mime types is browser dependent. But it is highly unlikely that any browser would consider image/png
as a supported scripting language, in which case, HTML5 requires that the file is not fetched.
See http://dev.w3.org/html5/spec/scripting-1.html#prepare-a-script with particular reference to steps 7 and 14.
Upvotes: 1