Thanks alot for your effort higorion, but unfortunately this didn't 
help at all.

I replaced the addEventListeners as yot told me to and pasted your 
code, but I got just the same error as before. I removed all 
listeners, and that seemed to stop IE from crashing, so it seems 
clear that it's the events that are causing the trouble.
I tried to put an alert at the top of your exit() function, but 
never got an alert on refresh, so the browser seems to crash before 
even running the exit() function.
Hmmmm.


SkrellK


--- In [email protected], "higorion" <[EMAIL PROTECTED]> 
wrote:
> 
> Hi,
> 
> sounds like a problem with cleaning up events at page unload.
> 
> this has been discussed as a problem only apparent in the 
combination 
> of internet explorer and svg viewer and can be avoided by using 
> something like:
> 
> function init(evt) {
>  if ( window.parent != null ) parent.onbeforeunload = exit;
> }
> function exit(evt) {
>  for (i=0; i<registeredEvents.length; i++) {
>   registeredEvents[i].removeListener();
>  }
> }
> 
> of course, to do so, you have to write some code to gather all 
> registered events in the array that gets iterated through in 
the "exit" 
> function. personally, i use something like:
> 
> var registeredEvents = new Array();
> function RegisteredEvent(argTarget,argType,argHandler) {
>       this.target = argTarget;
>       this.type = argType;
>       this.handler = argHandler;
>       this.addListener();
> }
> RegisteredEvent.prototype.addListener = function() {
>       this.target.addEventListener(this.type,this.handler,false);
> };
> RegisteredEvent.prototype.removeListener = function() {
>       this.target.removeEventListener
(this.type,this.handler,false);
> };
> function registerEvent(argTarget,argType,argHandler) {
>       registeredEvents[registeredEvents.length] = new 
RegisteredEvent
> (argTarget,argType,argHandler);
> }
> function unregisterEvent(argTarget,argType,argHandler) {
>       temp = new Array();
>       for (i=0; i<registeredEvents.length; i++) {
>               if (registeredEvents[i].target != argTarget || 
> registeredEvents[i].type != argType || registeredEvents
[i].handler != 
> argHandler) {
>                       temp[temp.length] = registeredEvents[i];
>               }
>               else {
>                       registeredEvents[i].removeListener();
>               }
>       }
>       registeredEvents = temp;
> }
> 
> finally, replace all occurences of "object.addEventListener
> (type,handler,false);" with "registerEvent(object,type,handler)" 
and 
> your events will be cleaned up before your page unloads.
> 
> cheers,
> 
> hannes
> 
> --- In [email protected], "skrellkolja" 
<[EMAIL PROTECTED]> 
> wrote:
> > 
> > Hi.
> > Anyone familiar to this problem?
> > It's an SVG application supported by javascript. When i pres 
refresh 
> > in the browser it just terminates, and the standard "Do you want 
to 
> > report error"-window appears. Sometimes refreshing works fine, 
but 
> > then it suddenly starts crashing.
> > 
> > Anyone who knows where to start seeking for errors?
> > 
> > Thanx alot!





-----
To unsubscribe send a message to: [EMAIL PROTECTED]
-or-
visit http://groups.yahoo.com/group/svg-developers and click "edit my 
membership"
---- 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/svg-developers/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to