I just copy infragistics required js and added scripts to my _Layout.cshtml <script src="@Url.Content("~/Scripts/jquery-1.7.1.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/jquery-ui-1.8.20.min.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/modernizr-2.5.3.js")" type="text/javascript"></script> <script src="@Url.Content("~/Scripts/infragistics.loader.js")" type="text/javascript" ></script> <script src="@Url.Content("~/Scripts/infragistics.js")" type="text/javascript"></script>And start a project and getting error in infragistics.loader.js. Any idea how to fix it?
Microsoft JScript runtime error: Unable to set value of the property 'isDocumentReady': object is null or undefined on $(function(){$.ig.isDocumentReady=true;
Hello Alex,
I've tried to reproduce your scenario but unsuccessfully. The only case when this error may happen is when $.ig is undefined (or destroyed between it's definition and jQuery ready function call). If possible can you set a breakpoint in the very beginning on the loader js file and see if $.ig is successfully defined? You could also send over your project we'll take a look over here.
I got the same error too. I'm using the trial version to see if we want to buy the jquery product.
When debugging, $.ig is undefined inside the function but defined outside of the function.
$.ig.isDocumentReady = false;
$(function () { $.ig.isDocumentReady = true; if ($.ig._loader) { $.ig.loader()._notifyLoaded() } })
If I take out the function part for a temporary fix, I get an error on $.ig.TrialWatermark, saying again that $.ig is undefined. Any help to fix it would be greatly appreciated, as we really want to try out the product! :)
Hi,
This can happen if you end up including jQuery's js files more than once in the page that is being loaded. MVC4 will, by default, define a bundle for the jQuery libraries and assign it to download in the body of _Layout.cshtml. The solution is to ensure that jQuery is being loaded only once by your file. You may want to remove the bundled include of jQuery from _Layout.cshtml, or move it to head, or move it to right before you include the reference to infragistics.loader.js.
Does this help?
-Graham
P.S. there are a few other things about the default template in MVC4 that can be a bit problematic. For example, it defines a border on the body element. Which can play havoc with anything that is using the offset function in jQuery to determine an element's offset, due to some layout cases that jQuery ignores.
You are actually likely experiencing some sort of interleave between scripts that are loaded in the head, vs, scripts that are being deferred till later. If you have defined a load of jQuery in the head and then our loader is loaded in the head, and then the body scripts load in which the default _Layout.cshtml in MVC 4 does this:
@Scripts.Render("~/bundles/jquery")
This ends up redefining $ so you end up losing the ig namespace that was added to it by the loader.
You might find the simplest solution is to move the above line up to the head section of _Layout.cshtml and then don't try to include jquery anywhere else, and this should avoid redefining $ halfway through the page load ;-)
Wow!!!! Thanks so much. That fixed it..