How to handle context menu cancellation event

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zinon
    New Member
    • Mar 2012
    • 1

    How to handle context menu cancellation event

    I am trying to implement a system to mask affiliated links
    of a web page. I can handle user's right click with
    oncontextmenu event and mask the link without any problem
    but when user cancels context menu, link value is been
    changed.

    Code:
    link.oncontextmenu = function () {
      link.href = "http://......";          
    }
    I cannot find a way to handle when user cancel context
    menu to change link's value into its original value.

    Any idea?

    Thanks.
Working...