JQuery Offset Width Error

Topics: General, Writing modules
Apr 17, 2012 at 7:40 AM

Hai,

I am getting jquery error in IE 9 while using below code in my Orchard Module.It is working in Firefox and Chrome but not in IE 8/9.

This issue is not happening in normal asp.net application.This Occurs only in my Orchard Module.

 


 

 

Code: 

 

$("<div>Hello</div>").dialog();

 

 


 

 

Error: 

Microsoft JScript runtime error: Unable to get value of the property 'offsetWidth': object is null or undefined

in "jquery-1.7.1.js" line number 3164.

event.target.offsetWidth --- > when i debbugged, it says event.target is undefined and Also this error always occurs when a jquery focus method calls.

 


 

This same error occurs when i am trying to use JQuery AutoComplete Plugin for a TextBox.

I am  not using focus method explicitly,But it calls internally inside JQuery Dialog and AutoComplete plugin.

So it throws "offset width" error while setting focus to an element.

 

Please help me to solve this.

Thanks,

R.Suresh

Apr 17, 2012 at 3:00 PM
Edited Apr 17, 2012 at 3:01 PM

Hai,

I found the issue.

I have a DOJO Toolkit (Javascript Api) Grid Control in my Orchard Module.This causes the JQuery Dialog error.

If i removed that Grid from my page,Then Jquery dialog works fine.Otherwise not.

But still i am not able to fix the issue.I want to use both Jquery plugin and Dojo plugin in my Orchard Module.

This issue happens only in IE Browser.

If anybody knows this issue,please give me a solution.

Thanks,

R.Suresh

Coordinator
Apr 17, 2012 at 10:58 PM

Dojo, that's a name I haven't heard in a few years. It's generally not a very good idea to mix JS frameworks. I'd look for an equivalent jQuery plug-in.

Apr 18, 2012 at 7:11 AM
Edited Apr 18, 2012 at 7:11 AM

I am using ArcGIS JavaScript Map Viewer (ESRI Javascript Api) in my Orchard Module.That ArcGIS Javascript Map Viewer is built using the Dojo Api.So,that is why i used Dojo for UI's like Custom Widget.

Also i need an AutoComplete Textbox which is not in Dojo,so i used Jquery to serve that purpose.

Coordinator
Apr 18, 2012 at 5:53 PM

Well, if you need Dojo, use only Dojo and use their autocomplete. Don't mix them.