Skip to content

IE7, removeFromStack(), up is null or not an object #125

jonatrey opened this Issue Sep 3, 2011 · 15 comments

5 participants

jonatrey commented Sep 3, 2011


This issue seem to only happen in IE7.
Library version:

This only happens in this specific case:

CRT_XDM.socket = new CRT_XDM.easyXDM.Socket({
remote: "remote_url",
container: document.getElementById("container"),
onMessage: function(message, origin){
this.container.getElementsByTagName("iframe")[0].style.height = parseInt(message) + "px";
onReady: function() {

var message_interval = setInterval(function() {
var posTop = mypos;

var message = posTop+";"+document.documentElement.clientHeight;

if(message != prevMessage){
  prevMessage = message;

}, 1000);

If I move the postMessage in "onMessage" or outside the setInterval, the error disappear.


scrolling and allowtransparancy can be applied directly using the props object.

I've not seen this error before, and to be honest, I don't see how it could come about as up will always be set...
If you could set up a test case then I might get to look at it.

jonatrey commented Sep 5, 2011


I've put a test case together:

To see the issue, you have to use IE7 and resize de window. (since it's what is checked in setInterval). I was not able to reproduce it, nor on IE8, IE9, Chrome, firefox and safari.As a temporary fix, I removed messaging on IE7.


Do the official examples work for you in IE7? If that's the case then this is implementation-bound.


Also try removing the namespacing (noConflict) and see if this has anything to do with it.


Why is the setTimeout in the top document and not in the iframe?

Why is loaded twice in the iframe? This could have something to do with it.

Never debug such things using minified code and packers..

jonatrey commented Sep 5, 2011

Yes, your examples do with IE7.

Removing the noConflicts also removes the error :-)

When digging around to find why I had this error, when I saw your comment about nConflict on post, I thought it couldn't be it.

jonatrey commented Sep 5, 2011

In fact those are not the same js, there is widget.min.js (my widget), and widget_iframe.min.js (easy XDM packed). The way I've build it the app, JS are compressed on the prod server and you don't have access to the dev server.

Looks like we are moving forward:
1. If I change remote url to something like "", the error disappear,
2. If I remove the "noConflict" part, the error disappear too.

I feel the error isn't triggered by the consumer, but rather the provider. But if really is the case, how would you explain that I can work around the error by simply adding that to my consumer:

if(ieversion == null || ieversion>=8){

jonatrey commented Sep 5, 2011

Just to answer your question about the setInterval:

I have a setInterval in both the consumer and the provider.
Consumer: To detect the scroll position
Provider: To detect the size of the div contained in the iframe

I need the scroll position to be able to center overlays that popup from inside the iframe. Without this scroll pos, the overlay would be vertically centered within the iframe and not within the doc.

jonatrey commented Sep 9, 2011

I just found the root cause, this is probably a user mistake: On my provider I was using the socket to post a message without checking whether it was ready or not. Issue closed.

@jonatrey jonatrey closed this Sep 9, 2011

Using a socket before it's ready should not be a problem as the stack buffers these. So you it might actually be that you have found a bug in the way the QueueBehavior, that handles the buffering, removes itself from the queue after doing its job..

@jonatrey jonatrey reopened this Oct 15, 2011


No matter how I use the socket, removeFromStack is always failing at some point on IE7 (element.up is null).

Here is how I modified the function to work around the error:


  • This will remove a stackelement from its stack while leaving the stack functional.
  • @param {Object} element The elment to remove from the stack. */ function removeFromStack(element){ if (element.up == null) { element.up = element.down = null; } else { element.up.down = element.down; element.down.up = element.up; element.up = element.down = null; } }

I'm seeing this error intermittently in IE7 however @jonatrey's workaround results in 2 iframes being added to the page. Happy to provide info.


I also see this error but used the @jonatrey fix. It works for ie6/7 and these browsers are going the way of the dodo...


Ok, this definitely deserves attention.

I have a popup implementation similar to the bridge.html example. Works fine in all browsers but IE. 2 days of debugging later, I have removed the noConflict directive after discovering this thread, and it works.

So, I'll be opening a new Issue for this, which I'll post here...


Ok, opened #192 to track the noConflict issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.