Ticket #7104 (closed bug: wontfix)
jQuery 1.4.2 not running within IE9 Web Browser control (incl. solution proposal)
| Reported by: | pmuessig | Owned by: | |
|---|---|---|---|
| Priority: | low | Milestone: | 1.4.3 |
| Component: | core | Version: | 1.4.2 |
| Keywords: | Cc: | dmethvin | |
| Blocking: | Blocked by: |
Description
When using jQuery inside Eclipse within a dynamic web project you can run you web application within the Web Browser control.
I noticed that somehow the jQuery object was not available. I checked where the execution of the jquery-1.4.2.js file failed and find out that the Web Control throws a TypeError when it executes line 905.
By adding a try catch the jQuery works again:
900: // Make sure that the execution of code works by injecting a script
901: // tag with appendChild/createTextNode
902: // (IE doesn't support this, fails, and uses .text instead)
903: if ( window[ id ] ) {
904: jQuery.support.scriptEval = true;
>>>> try {
905: delete window[ id ];
>>>> } catch (e) {
>>>> // somehow this line does not work in the IE9 Web Browser control
>>>> //alert(e); // => throws a TypeError: Object doesn’t support this property or method!
>>>> }
>>>> }
Change History
comment:2 Changed 3 years ago by pmuessig
I can confirm that jQuery works fine in IE9 beta 1.
But within the Web Browser control (embedded IE) in Eclipse jQuery fails. Maybe this is only a beta bug of IE.
For the people working in Eclipse and using the embedded IE for previewing their application this little fix allows to run jQuery.
comment:3 Changed 3 years ago by snover
- Cc dmethvin added
- Priority changed from undecided to low
Does it work with IE8 in Eclipse? If so, this sounds like an IE beta bug, not a jQuery bug. Also, please provide the version of Eclipse.
cc dmethvin for a second opinion.
comment:4 Changed 3 years ago by pmuessig
Yes, it works with IE8 in Eclipse (Helios SR1 64bit). I noticed this issue after installing the IE9 beta. Do you think this bug will be fixed by IE? If not this simple try catch can help.
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

jQuery works fine in IE9 beta 1. What version of IE9 are you trying to use? Can you confirm that it works / does not work outside of Eclipse? I am not sure that IE-in-Eclipse is one of the supported jQuery platforms.