开发者

how to remove toolbar during onload function?

开发者 https://www.devze.com 2022-12-21 05:14 出处:网络
I have got one critical problem in Javascript; please help me to fix it. I have written the onload function in one JSP page, say login.jsp.

I have got one critical problem in Javascript; please help me to fix it.

I have written the onload function in one JSP page, say login.jsp.

In that function I used the window.open method to open a new window again with the same JSP page login.jsp with the toolbars disabled.

Now what is happening is that when I am opening the same page again in a new window, obviously that body onload function will get called 开发者_Go百科again and it opens a new window in an indefinite loop.

But what I want is, I have to remove that onload function in that JSP page once a new window is opened.

Is it possible to remove that onload function while it is getting opened in the new window?

Could anyone please come up with an idea or little bit of code to do this using java script??


In your onload, check if the window.opener property is null.

If yes, open the new window.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号