简体   繁体   中英

ASP.NET MVC: jQuery UI and other scripts loaded unexpectedly

I've got a ASP.NET MVC project on the run. On page load, the easing function of easeOutQuad is immediately used. However, sometimes when I load the page, it says there is no function called easeOutQuad, which no doubt, means the jQuery UI library has not been loaded properly. Other times it works well. I've checked the loading order in the output source code a couple of times, and I can assure you that the order - jQuery, jQuery UI, inline script, shouldn't be the key to the problem. Any insight into this issue?

PS: The connection quality may be associated with this phenomenon. Given this I still don't know how to avoid it.

Without a single example of your code it's tough to say. However, I am guessing, given the nature of your issue, that your call to easeOutQuad is not wrapped in the jQuery document-ready method. Try this:

jQuery(document).ready(function($) {
    //your call to easeOutQuad
});

If it is already wrapped in this call, or doing so does not affect your issue, please post enough code to replicate the issue so we can be of further help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM