Why does the window.open script not work with the "no" command?

Asked

Viewed 249 times

0

I noticed that it works to replace the "no" command with "yes" in the window.openscript. However, it seems that "no" and "0" are not interpreted at all. I have tried to put "Hidden" and nothing either. What can I do to solve the problem? I wouldn’t want the window to open with the address bar or the window to be resizable. I’m posting the code I’m using. I really appreciate anyone who can help me.

<script>
        function openWindow() {
           window.open("banner", "_blank", "location=no,resizable=no,width=700px,height=421px");
        }
        var timer = setTimeout("openWindow()", 10000);
</script>

2 answers

2

Not all browsers support the features of open window.(). For example, the resizable=no and the location=no will only work in IE. Some browsers in earlier versions (such as Firefox, for example) were able to do so via settings, but this option was removed in later versions.

Therefore, thinking about using pop-up and restricting its features is something discouraged. If you want to use it, you have to use without worrying if the user will resize it, move it, see the address etc. The important thing is the contents of the window, and this you can manipulate as you want.

Initially these options were intended to work by default on all browsers, but some manufacturers felt that the developer/programmer should not have full control over the window, so most browsers ignore some options, as is the case with resizable and location. Basically, what remained standard and functional in all browsers were the properties width, height (who doesn’t need the px, because the value is already in pixels), top and left.

In addition, as it is opening the pop-up, without user interaction, it will be blocked natively by the browser, and the user would have to authorize pop-ups on the page.

0

As described here, just list the parameters to be enabled. That is, remove location and resizable.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.