开发者

'jQuery' is undefined

开发者 https://www.devze.com 2023-04-03 13:51 出处:网络
I\'m trying to use the Fullscreenr Jquery plugin in my asp.net project.Here is the code on my master page:

I'm trying to use the Fullscreenr Jquery plugin in my asp.net 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(FullscreenrOpti开发者_运维问答ons); line. The full error is :

Microsoft JScript runtime error: 'jQuery' is undefined.

Any ideas?


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

精彩评论

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

关注公众号