buttonclick - javascript linking onclick to a .js to a file -


i created .js file, , included in html pages by:

<script type="text/javascript" src="yourexternalfile.js"></script> 

how call function of .js file using onclick = "...." ?

i know like:

<input type="button" value="exit" onclick="javascript: ???;" > 

but can't figure out...

if using jquery, can this,

       <input type="button" onclick="javascript: $.getscript('../scripts/yourfilepath' , function (){ youfunctioncall() ; } );" /> 

this download js file when button cliked , shall execute function called within.


Comments

Popular posts from this blog

mysql - How to insert just year and month into date field? -

mod rewrite - Doing external redirect. .htaccess NS flag not working. How to achieve similar results? -