javascript - How to execute a href without redirection -


i want execute href without redirecting me page. execution in background. here code

    <a id="speechoutputlink" href="http://translate.google.com/translate_tts?tl=fr&q=text" rel="noreferrer" >download</a> 

when click on the href download don't want redirected page of google translator. how can this?

use jquery's event.preventdefault() method:

if method called, default action of event not triggered.

$('a#speechoutputlink').on('click', function(e) {     e.preventdefault();      ... }); 

Comments

Popular posts from this blog

php - Submit Form Data without Reloading page -

linux - Rails running on virtual machine in Windows -

php - $params->set Array between square bracket -