开发者

'jQuery' is undefined (jquery library in asp.net mvc 2.0 header)

i have a jquery plugin which spits the following error when i try run it with the main jquery library in the master page header.

this is my setup to produce the above error:

  1. I have the jquery reference in the header of the masterpage
  2. I put a reference to jquery.easyAccordion.js in my content page header
  3. I p开发者_Go百科ut the function code in the content page as well

Whenever I try to call the page I get the 'jquery is undefined error'.

It sounds like the jquery library is not getting loaded before the plugin but i'm not sure as it is the first item in the masterpage header.


Have you got any developer tools. Fiddler, Firebug, Chrome Debugger all have network tabs that allow you to see if resources are being loaded correctly. You can see an example below of the chrome debugger showing jquery has loaded. In this instance you need to ensure jquery is being loaded with a response code of 200 or 304, use one of this tools and ensure your jquery file is not returned with a status codes of 404 (file not found).

This is the first thing to check, let me know what the outcome is and if it does not solve your issue we need to look at other reasons.

'jQuery' is undefined (jquery library in asp.net mvc 2.0 header)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜