开发者

Link and onClick?

开发者 https://www.devze.com 2023-01-23 09:09 出处:网络
I am trying to replace contents of a div with a link. The website is set up so that the link sets the div to a new "stream", and I need to modify contents of that stream after.

I am trying to replace contents of a div with a link. The website is set up so that the link sets the div to a new "stream", and I need to modify contents of that stream after.

Es开发者_开发问答sentially, I need my onClick even to fire after the href link. How can I achieve this? I am working in Chrome, it appears to fire the onClick before following the link.


OnClick on an a element always happens before the link is followed. It is not possible to first navigate to some other page, and then run some javascript from the previous page.

I don't fully understand what you are trying to do, but I think the best way is to do everything in Javascript, and do them in the correct order.


did you try innerhtml

http://www.tizag.com/javascriptT/javascript-innerHTML.php

0

精彩评论

暂无评论...
验证码 换一张
取 消