Jump to content

Window.open opens window in new browser tab?


jekillen
 Share

Recommended Posts

I have a project that uses javascript window.open to open a window that loads a php enabled html form page.

 

When the window is originally opened, it opens in the expected separate window.

 

BUT, if I use one of the buttons assigned event handlers that call form.submit()* (method is set to post)

* in the separate window. This is a self processing html/php form page.

 

The resulting page opens in a new browser tab with the original window still opened but unresponsive

to events.

 

I am developing in Firefox 34.0.5. But I am assuming that this would be encountered on any DOM

browser type and version.

 

This is the first time I have encountered this phenom, even in this same project.

 

What could be causing Firefox to open a new tab for the same html/php file?

 

Possibly a js var naming conflct with the target attribute in an html element such as <a> or <form>?

EDIT:

Yes, that was the problem:

I had a variable named 'target' that is supposed to hold path information and then refered to it

and had some code manipulations to it in a 'with(document.forms.formName)' block. The result

seems to have set the target attribute of the form.

 

But it may be useful to know how to program javascript to open windows in a separate tab intentionally.

 

Thanks for time and attention

JK

Edited by jekillen
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...