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

Javascript line number mapping -

c# - Is it possible to remove an existing registration from Autofac container builder? -

php - Mysql PK and FK char(36) vs int(10) -