Category Archives: IE

Stack overflow at line: … in IE

I recently came across a strange issue with IE. All of a sudden one of my pages started giving “Stack overflow at line: 0” and I had no idea why that was happening. This didn’t happen in Firefox though. After a bit of searching, didn’t really come across any valid solution other than some microsoft support page talking about too many modal windows causing such an issue.

He is what I finally found with my page. I have the following code

<body onload="onload(event);">

In one flow, this dynamically generated page has the onload javascript function and that works fine. However, in another flow of the same page, the onload javascript function is not implemented. So, in case of IE, it looks like it’s ending up in recursive loop on itself and hence the stack overflow. Had I written the code to

<body onload="onloadfunc(event);">

then in the second flow, it would have simply thrown a regular javascript error that the function doesn’t exist. Hopefully now this mystery is solved for you!

1 Comment

Filed under IE, javascript

Dragging an Image in IE

I had a requirement to drag an image. So, I implemented the onmousedown, onmouseup and onmousemove on the image and it worked fine in Firefox. One thing I had to do is to prevent the default browser behavior taking place. This can be done in Firefox using event.preventDefault(); Preventing an event in IE is done differently, using event.cancelBubble = false; and event.returnValue = false; So, I used these two statements for IE. But it didn’t work. IE was still ending up using the default image dragging behavior.

So, after a bit of research, I did the same preventing of default image for IE but on the ondragstart event of the image. Now I can drag the image in both IE and Firefox to achieve a custom drag behavior.

Leave a comment

Filed under IE, javascript