Multiple javascript window.onload solution -


before ask questions, ever post questions don't understand implement in code. have code this

window.onload = function() {  var url  = getqueryvariable("url");  document.getelementbyid('view').src = url; } window.onload = function() { var linkdirect = document.getelementsbyclassname("frame"); (var = 0; < linkdirect.length; i++) { linkdirect[i].href = "http://namablog.blogspot.com/p/demo.html?url=" + linkdirect[i].href } } 

then, how can make code execution using 1 window.onload

you can use addeventlistener or jquery equivalent.

window.addeventlistener('load', function (){     alert('function #1'); });  window.addeventlistener('load', function (){     alert('function #2'); }); 

be sure call these before window loaded.


Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -