c# - Why isn't this very simple JQuery working? -


this question has answer here:

i trying pass width of page variable c# code behind asp.net, , receiving empty strings. narrowed down problem jquery function not firing. changed simplest code test if function doing anything:

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">     $(document).ready(function()      {            alert("hello");     }); </script> 

and yet, still nothing.

  1. i've included jquery
  2. i've triple checked syntax
  3. no errors reported in console
  4. i looked through other similar 'facepalm' questions, none of solutions work (see above)

what incredibly obvious thing missing?

you can't simultaneously set [src] attribute , include contents <script> element.

if need 2 scripts, need use 2 separate <script> elements.

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> <script>     jquery(function($) {         alert("hello");     }); </script> 

as per html5 spec on <script> element:

if there no src attribute, depends on value of type attribute, must match script content restrictions.
if there src attribute, element must either empty or contain script documentation matches script content restrictions.


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -