最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - 'jQuery' is undefined - Stack Overflow

programmeradmin1浏览0评论

I'm trying to use the Fullscreenr Jquery plugin in my asp project. Here is the code on my master page:

<script src="Fullscreenr/jquery-1.3.2.min.js" type="text/javascript"></script>

<script src="Fullscreenr/jquery.fullscreenr.js" type="text/javascript"></script>

<script type="text/javascript">
    var FullscreenrOptions = { width: 907, height: 680, bgID: '#bgimg' };
    jQuery.fn.fullscreenr(FullscreenrOptions);
</script>

It fails on the jQuery.fn.fullscreenr(FullscreenrOptions); line. The full error is :

Microsoft JScript runtime error: 'jQuery' is undefined.

Any ideas?

I'm trying to use the Fullscreenr Jquery plugin in my asp project. Here is the code on my master page:

<script src="Fullscreenr/jquery-1.3.2.min.js" type="text/javascript"></script>

<script src="Fullscreenr/jquery.fullscreenr.js" type="text/javascript"></script>

<script type="text/javascript">
    var FullscreenrOptions = { width: 907, height: 680, bgID: '#bgimg' };
    jQuery.fn.fullscreenr(FullscreenrOptions);
</script>

It fails on the jQuery.fn.fullscreenr(FullscreenrOptions); line. The full error is :

Microsoft JScript runtime error: 'jQuery' is undefined.

Any ideas?

Share Improve this question edited Sep 6, 2011 at 16:10 Tomalak 338k68 gold badges546 silver badges635 bronze badges asked Sep 6, 2011 at 15:53 brokebroke 8,31216 gold badges58 silver badges85 bronze badges 2
  • are you mixing and matching jquery versions? – Daniel A. White Commented Sep 6, 2011 at 15:55
  • 2 is jQuery actually located at src="Fullscreenr/jquery-1.3.2.min.js" as your code sample shows? – JAAulde Commented Sep 6, 2011 at 15:56
Add a ment  | 

5 Answers 5

Reset to default 6

It's most likely that your src path is wrong. Use the network viewer that will be present in the developer tools of your favourite web browser, and check you're not getting a 404 response for the Fullscreenr/jquery-1.3.2.min.js resource.

You might find that the src is missing a leading slash, and in fact should be:

<script src="/Fullscreenr/jquery-1.3.2.min.js" type="text/javascript"></script>

Also check the case of the the path, in case your web server is case sensitive.

That most likely means that your URL for the jQuery source is incorrect. If you look in Firebug/Web Inspector/etc., do you see any 404's?

The path of jquery must be wrong you can try to use another path to test this, like from google. It could be that you need a leading slash or a tilde ~.

<script src="/Fullscreenr/jquery-1.3.2.min.js" type="text/javascript"></script>

or

<script src="~/Fullscreenr/jquery-1.3.2.min.js" type="text/javascript"></script>

Ensure that the jQuery script is loading via a debugging tool like Firebug, etc. and adjust the src path appropriately if necessary. Check that you don't have any JavaScript errors in the JavaScript console (again, use Firebug or similar). Try the code in other browsers (like Firefox, Chrome, etc--it looks like you're using IE) to see if the behavior is any different.

Try This: $.fn.fullscreenrResizer (instead of using Jquery, use the "$" symbol)

发布评论

评论列表(0)

  1. 暂无评论