Results 1 to 2 of 2

Thread: javascript detect page navigation

  1. #1
    Join Date
    Apr 2014

    javascript detect page navigation


    is there anyway at the onbeforeunload trigger to detect what page we are navigating too?

    basicalli if we are going to another page I wast to pup up a warning windowif you are just postiing back to yourself

  2. #2
    Join Date
    Mar 2005
    Behind you...
    There is no way to detect the destination URL in javascript. It's a security/privacy issue more than anything.

    However you could take the time to setup your page to get the behavior you desire. Essentially you would need to assign some special class or event to all links that leave the current page. This would allow you to identify which links are going to another page and which pages are simply posting back to itself.
    "Given billions of tries, could a spilled bottle of ink ever fall into the words of Shakespeare?"

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Recent Articles