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.
- i've included jquery
- i've triple checked syntax
- no errors reported in console
- 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
srcattribute, depends on value oftypeattribute, must match script content restrictions.
if theresrcattribute, element must either empty or contain script documentation matches script content restrictions.
Comments
Post a Comment