right click on html link which execute javascript

后端 未结 1 727
被撕碎了的回忆
被撕碎了的回忆 2021-01-24 08:44

When i click a link, i want to execute a javascript function to get the dynamic url. So i did like below.

 a link          


        
1条回答
  •  终归单人心
    2021-01-24 08:55

    Short answer: No, you can't.

    But since you are using JS anyways, you can just use it to change the href attribute in , so by the time the user clilcks on the link, it's already pointing to the right URL.

    0 讨论(0)
提交回复
热议问题