hi, i cant figure out why this doesnt work:
index.html
main.jsCode:<html> <head> <script type="text/javascript"> function includescript(sourcefile){ var scriptNode = document.createElement('script'); scriptNode.type = 'text/javascript'; scriptNode.src = sourcefile; document.getElementsByTagName("head")[0].appendChild(scriptNode); } onload=function(){includescript('main.js')} </script> </head> <body> <div id="login">loading...</div> </body> </html>
loginform.jsCode:includescript('functions.js'); if (document.getElementById('login')){ document.getElementById('login').innerHTML = '<script type="text\/javascript" src="loginform.js"><\/script>'; }else{ alert('You must create a login div!'); }
the problem is that main.js does not include functions.js OR change the login div to display it works!....Code:document.write('it works!');
nvm i got it...


LinkBack URL
About LinkBacks

Reply With Quote
