I'm trying to get the BlockUI plugin to work normally, and it's not working (and behaving very strangely when I do some hacks with $.noConflict to make it work temporarily).
This is an ASP.NET application. Scripts loaded by the page per the debugger are:
bootstrap.js
modernizr-2.6.2.js
respond.js
jquery-1.10.2.js
jquery.unobtrusive-ajax.js
jquery.blockui.js
<my javascript file>.js (Contains my javascript; no jquery plugins; I've tried commenting everything but BeginWorking() below in here).
When I call my function with $.noConflict(), the BlockUI code works the first time. On subsequent calls, the JQuery object ($) has been mangled, and no JQuery functions will work any longer. See below code:
function BeginWorking() { $('#loadingImage')[0].style.display = "inline";
$('#statusText')[0].style.display = "none";
$('#cancelButton')[0].style.display = "none";
$.noConflict();
$.blockUI();
Reloading the page and executing the same code except without calling $.noConflict(), the Jquery object is no longer mangled, but I get the following error on the line where I call $.blockUI(), in Chrome:
Uncaught TypeError: Object function ( selector, context){
// the jQuery object is actually just the init constructor 'enhanced'
return new jQuery.fn.init(selector, context, rootjQuery );
} has no method 'blockUI'
This seems to imply the plugin file for blockUI is not found but clearly it is there, because I can call $.blockUI() if I precede with $.noConflict().
All of this would lead me to believe that multiple versions of JQuery are running, and that's breaking the plugin, but based on my includes that seems very unlikely. Would it be a definite thing or extremely likely that one of these plugins is erroneously trying to override the JQuery object? (Please note - JQuery.blockUI also does not work, despite the above weirdness working temporarily) Would something else cause this behavior?