SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict Mirek Komárek's Avatar
    Join Date
    Dec 2006
    Location
    Prague
    Posts
    210
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Remove event onunload

    I am not practically sure how to remove an event on unload. In this example http://xy.wz.cz/table-title-crosshover.html which I send few days ago to another thread is problem during leaving page. When you press home, or go to another page from there and then mouseover table it will throws error that hover (function) is not defined. Is here any universal way to remove all events onunload? I found this bookmarklet http://www.squarefree.com/bookmarkle...tml#zap_events for something similar, but I was not successful in implementation. Probably I do not understand some theoretical javascript ground.

  2. #2
    SitePoint Evangelist hexburner's Avatar
    Join Date
    Jan 2007
    Location
    Belgium
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't understand what you want here.
    Why unload the onmouseover-event?
    If you close the page, or you go to a page other than http://xy.wz.cz/table-title-crosshover.html, then all events for that page will be removed automtically, by any browser.

    If you get an error when going to another page, without unloading any events, then there's probably something wrong with the page you are going to. Check in the page you go to if you're initializing an event that uses the function hover.

    I hope it's just a logical err...

    Grtz, Vince

  3. #3
    SitePoint Addict Mirek Komárek's Avatar
    Join Date
    Dec 2006
    Location
    Prague
    Posts
    210
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No it is not a error at another page, when you in firefox open error console and go to any page from there and at the moment when you go to any any page and mouse over table it will produce a lot of errors, because javascript is already removed, but onmouseover is still there. I do not how to explain it better. For better understanding I add there a link to big image, click link to that 200kb image and mouse over table and you will see what I mean, at least in firefox.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •