[Dojo-interest] Re: IE Javascript error with Tooltips and iframes

Friedl, Justin JFriedl at cdgnow.com
Mon Nov 13 09:33:06 MST 2006


I'm having the same problem.  I am calling destroy on a contentPane.  Then
when I click, or scroll on the area where the pane previously was I get the
"Can't execute code from a freed script" error in IE.  I don't get it in
firefox.  

Thanks

-Justin


Hi,

We just upgraded to dojo 0.4.0 A few days ago and stared getting the 
following error in IE6 (maybe 7 too I have not tested yet):

"Can't execute code from a freed script"

It is happening when using Tooltips from within an iframe (both the main 
page and the page in the iframe use dojo).  It does not happen when the 
page is first loaded, but after the iframe src is changed (even if it is 
changed to the same page).

The error is reported on this line, mjp.kwAddAdvice(ao);, inside 
dojo.event.connect.  Which is called from 
dojo.widget.PopupManager.registerWin at the line, 
dojo.event.connect(win, 'onscroll', this, 'onClick');

This is about as far as I managed to track it down so far and am now at 
a loss as to what might be happening.  Below is the smallest example 
code I could come up with to reproduce the error:

Thanks.

-Mark


<!-- Main page: test_tooltip.html -->

<html>
<head>

<!--
  For some reason the error does not occur in this example without 
djConfig getting set here.
  However it does happen without this in our application.
-->
<script type="text/javascript">
//<![CDATA[
var djConfig = {isDebug: true, debugAtAllCosts: false};
//]]>
</script>

<script src="dojo/dojo.js.uncompressed.js"></script>

  <script>
    //This require does not have to be Tooltip, it can be some other 
dojo widget,
    //some "reqire" is required to reproduce the bug (in our app we have 
a bunch).
    dojo.require("dojo.widget.Tooltip");
   
    function reloadIFrame()
    {
      document.getElementById( 'content' ).src = "tip_frame.html"
    }
  </script>

</head>
<body>
<a href="#" onclick="reloadIFrame(); return false;">Reload iFrame</a><br/>

<iframe id="content" style="width: 200px; height: 200px" frameborder="1" 
src="tip_frame.html"></iframe>
</body>

</html>


<!-- Page in iframe: tip_frame.html -->

<html>
<head>

<!--
  For some reason the error does not occur in this example without 
djConfig getting set here.
  However it does happen without this in our application.
-->
<script type="text/javascript">
//<![CDATA[
var djConfig = {isDebug: true, debugAtAllCosts: false};
//]]>
</script>

<script src="dojo/dojo.js.uncompressed.js"></script>

<script>     
 dojo.require("dojo.widget.Tooltip");
</script>

</head>
<body>
  <span id="tt">Tip Here</span>
  <span dojoType="tooltip" connectId="tt" caption="Tooltip" ></span>
</body>
</html>

-- 
--------------------------------
Mark McManus
Director of Software Development
Kanayo Software Inc.
(902) 423-2032 x105
www.kanayo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://dojotoolkit.org/pipermail/dojo-interest/attachments/20061113/63439dfd/attachment-0001.html


More information about the Dojo-interest mailing list