I have links like this:
<a href="#" onclick="myfunc({a:1, b:'hi'})" />click</a>
<a href="#" onclick="myfunc({a:3, b:'jo'})" />click</a>
And I would like to do a preventDefault()
inside myfunc()
, because a #
will be added in the address bar when clicking on the link
(without doing return false;
or href='javascript:void(0);'
)
Is this possible?
Can I get the event inside myfunc()
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…