What if script tag has both "src" and inline script?

5k views Asked by At

I am wondering what if one script tag has both "src" and inline script. I tried below code.

<script src="http://yui.yahooapis.com/2.8.1/build/yahoo/yahoo-min.js" type="text/javascript" charset="utf-8">
         alert('hello');
</script>
<script type="text/javascript" charset="utf-8">
         alert(YAHOO);
</script>

It the "alert('hello')" seems never executed in Firefox and Chrome. I tried to change the src to point to non-existent URI. The "alert('hello')" is also not executed.

So, inline script is always ignored if there is src attribute in script tag?

0

There are 0 answers