java - apply javascript at run time when user click on button -
this question has reply here:
load , unload javascript @ runtime [duplicate] 3 answerson website when button clicked other javascript should download server , apply current page.
is possible that, please share info on it.
thank you
basically want trying is
<input type="button" class="btntab" onclick=\'$p.apply.javascript('+ v_id +',"'+v_url+'")\' value="'+lg('applyjava')+'" style="margin:10px 0px;" >
above code display button , on click phone call function $p.apply.javascript 2 parameters (id , url download javascript)
here in below function
$p.apply.javascript(v_id, v_url){ here want download javascript , apply on current page...which located @ window.location = 'http://www.example.com/java.php?url='+ v_url; }
what above function doing redirecting me
http://www.example.com/java.php?url='+ v_url;
and displaying javascript in browser. instead want download javascript , apply on current page (may after page refresh or something)
could 1 please share info if have done similar or know how this.
thank you...in advance
you can utilize function load css or js file on run
function loadjscssfile(filename, filetype){ if (filetype=="js"){ //if filename external javascript file var fileref=document.createelement('script') fileref.setattribute("type","text/javascript") fileref.setattribute("src", filename) } else if (filetype=="css"){ //if filename external css file var fileref=document.createelement("link") fileref.setattribute("rel", "stylesheet") fileref.setattribute("type", "text/css") fileref.setattribute("href", filename) } if (typeof fileref!="undefined") document.getelementsbytagname("head")[0].appendchild(fileref) }
java javascript
No comments:
Post a Comment