Why is my onload function not working?

Here is the index file to my web application located in the host_name directory. I call public static function reload() { $uri = 'http://'; $uri .= $_SERVER['HTTP_HOST']; header('Location: '.$uri.'/host_name'); } to reload the page b2e.htm after a use logs in. This works. However, the onload functions are not called in my .js file - here. There is only one .js file included in both b2e.htm and b1e.htm. window.onload=n; function n() { var a; if(a=document.getElementById('f0d')) { a.onclick=i0; document.getElementById('f1e').onclick=i1; } else { document.getElementById('f2a').onclick=i2; document.body.style.backgroundColor="#eeeeee"; } } basically the statements in the else should execute but the are not.
Where do you have i0, i1 and i2 functions defined? Any console errors?

以上就是Why is my onload function not working?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准