javascript - Anchor tag href first and then onclick -


is possible execute href first , onclick event, of anchor tag?

framedoc.body.innerhtml+='<div style="margin-left:10;"><li class="highlight"><a href="'+tmp1+'"  onclick="highlightsearch(this);">'+searched_headings[l]+'</a></li></div>'; 

1.first open link 2.then process onclick function.

please suggest me...

no, thats not possible, click event executes first , redirected page specified in href attribute of anchor tag. so, instead add in query parameters in href , on new page check parameters , execute click event new page. example::

//tmp1 href var tmp1 = "http://www.somesite.com/somepage"; //add query parameter tmp1 += "?dosomething=1"; 

on redirecting new page, check dosomething , execute click event.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -