views:

45

answers:

3

in a page of my asp.net mvc website jquery not worked.

when i test the html source then i see the jquery script is not written

but i used only one master page to load all jquery on every page .

so where my jquery. when i debug my jquery then error found $ is not defined off course it come because jquery not load

are you know why my master page's jquery not come to my page even if i use same master page for all views of my website.

 <script type="text/javascript" src="http://www.google.com/jsapi"&gt;&lt;/script&gt;
    <script type="text/javascript">
        google.load("jquery", "1.4.2");
        google.load("jqueryui", "1.8.0");
    </script>
    <script language="javascript" type="text/javascript">
        $(function () {
  // Some other code here
        });
    </script>

when i check this jquery not found. i not know why but i am sure that i use same master page on all views [because i am only build a master page for it].

the problem is jquery not load to page but i don't know why he not load in my page

A: 

your code should be working

try using Firebug to see any javascript errors and debugging

you can also host your own copy of jquery

GerManson
A: 

You need to set the OnLoad callback for the JSAPIs from google.

function initialize() {
    $(function () {
        // Some other code here
    });
}
google.setOnLoadCallback(initialize);

Otherwise the jquery script hasn't loaded when the document ready function is evaluated.

Xenph Yan
A: 

try this piece of code to intialize

$(document).ready(function() { initialize(); });

Jaison Justus