Ticket #3697 (closed defect: invalid)

Opened 12 months ago

Last modified 3 weeks ago

"Can't execute code from a freed script" with IE6 and IE7 and dojo 0.4.3

Reported by: guest Owned by: dante
Priority: normal Milestone: 1.3
Component: General Version:
Severity: normal Keywords: 0.4.3 freed script IE
Cc: amram@…

Description (last modified by dante) (diff)

Hi,

I have a complex layout with an html frame using dojo, itself including iframes and plenty of javascript.

I faced a FATAL "Can't execute code from a freed script" on IE (not firefox, works fine) at some occasion when page reloads, due to some windows disappearing before dojo had time to "unregister them" apparently.

To solve this, I had to add 3 try {} catch blocks:

1/ In src/event/common.js, line 313:


REPLACE

mjp.kwAddAdvice(ao);

BY

try { mjp.kwAddAdvice(ao); } catch (e) { return null; }

2/ In src/event/common.js, line 452:


REPLACE

mjp.removeAdvice(ao.adviceObj, ao.adviceFunc, ao.adviceType, ao.once);

BY

try { mjp.removeAdvice(ao.adviceObj,ao.adviceFunc,ao.adviceType,ao.once); } catch (e) { return null; }

3/ In src/widget/PopupContainer.js, line 376

SURROUND THE BLOCK lines 376-382 WITH

try { if(win.PopupManagerRegistered){ dojo.event.disconnect(win.document,"onmousedown",this,"onClick"); dojo.event.disconnect(win,"onscroll",this,"onClick"); dojo.event.disconnect(win.document,"onkey",this,"onKey"); win.PopupManagerRegistered=false; } } catch (e) {}

Hope it helps, and bravo for this marvelous toolkit!!

--Eric

Change History

in reply to: ↑ description   Changed 12 months ago by guest

Just a comment to say I have the same issue (but only with IE7).
My testcase is:
dojo and widgets in my page, an iframe with dojo too. Reloading the iframe leads to the javasript error.
I'm using dojo 0.4.2

Thanks for the workaround it works fine, now I am waiting for a definitive fix.

  Changed 4 months ago by dylan

  • owner changed from anonymous to dante
  • milestone changed from 0.4.4 to 1.2

Please create a testcase for this with Dojo 1.1 and see if this is still relevant.

  Changed 2 months ago by dante

  • priority changed from high to normal
  • severity changed from critical to normal
  • description modified (diff)
  • milestone changed from 1.2 to 1.3

Could this (if it is in fact still an issue) be related to #3242

Lowering priority of this ticket as no noise on it in a while ... Not sure how to make a test case ...

  Changed 3 weeks ago by guest

http://www.akatombo.com/en/comments/cant_execute_code_from_a_freed_script/

look at this. I ran into a similar problem and googled it - everybody;s having this same issue and it is not related to dojo. The solution is the following:

"FIXED! About 10 minutes after posting this I found the bizarre (to me, maybe someone can explain it) solution for this problem. It was as simple as moving any meta tags before the script tags in the head element of the html document. <script><meta> = heartache <meta><script> = salvation."

  Changed 3 weeks ago by bill

  • status changed from new to closed
  • resolution set to invalid

Good, glad you found the solution. I'm closing this ticket; apparently there's nothing to do on dojo's end.

Note: See TracTickets for help on using tickets.