Opening new window exactly same as the parent window using javascript/jquery - javascript

I want to open web page in new window/tab. I want to make the new window to be exactly same as the previous one (with all the menubar, locationbar etc).
I tried
window.open ("http://www.google.com","mywindow");
In firefox it opened new tab and in IE it opened new window. This is ok.
But in chrome it opened new window without the standard buttons. I could only see the location bar; and all standard buttons were missing.
How to make it open the new window/tab which looks the same as the parent window?
Can I make it consistent to open either new window or new tab?

Related

How to open a new tab within window.open window - Javascript

I have below code for opening a new window.
window.open("https://www.w3schools.com", "_blank", "location=yes,height=570,width=520,scrollbars=yes,status=yes");
It opens new window as expected. If there is a link button within this new window, once user clicks on it, how to open it as new tab within the same new window instead of opening another new window in MS Edge.
Your help will be greatly appreciated. Thank you in advance!
I agree with serg06, when you use the provided code to open new window, you will find that it is just a popup, not a tab window. It doesn't have page navigation tool(go forward or backward), only when you convert it to a tab can you achieve your requirement. like this:
Otherwise, if you use target='_blank', you can only open a new tab in the parent page.

How to open pop up window, Javascript

I have noticed one thing when you press ctrl button + click a button or a link a new windows open in the same browser, I want same situation like that, I already studied the window.open() method which open a new window but with the latter method i am directed to the new window, I just to stay on the first page , not the one popups.
You can not decide how the user's browser handles the open window event, but to trigger the new window or new tab (based on the user's settings) you can do the following:
window.open(url,'_blank');
The _blank indicates the new window or tab to the browser.

why is window.open(url) opening new window instead of tab

I am calling window.open(url) and Normally that would just open a new tab.
However, On this particular page i am developing, it's opening a while new small window.
i've also tried window.open(url, "_blank")
Does anyone know what would force the window to open a new window instead of a new tab.
thanks.
The behavior is completely up to the browser and how it chooses to handle it. Most browsers open a new tab when _blank is used. There is nothing that can be done programmatically to control the behavior.

Opening URL in New Tab doesn't work in existing, programmatically-opened New Window (Firefox)

I am building a web app, for myself, to control some servers on my home network, and discovered what I think is very odd behavior in Firefox.
If you open a pop-up, via javascript, in Firefox, is it then impossible to open a new tab, via javascript in that pop-up? If not impossible, how do you do it?
Given a clean, default Firefox 3.6.3 installation...
If I open a page in Firefox and then call
var my_window = window.open('http://www.google.com','_blank','top=10');
A brand new "pop-up" window opens.
However, if instead I call
var my_window = window.open('http://www.google.com');
A get a new tab.
HOWEVER...
If I call the first version
var my_window = window.open('http://www.google.com','_blank','top=10');
And then in the new "pop-up" that opens, I call
var my_window = window.open('http://www.google.com');
It opens a new tab in the original window, not a new tab in the pop-up.
This seems very odd, and not intuitive at all. Why would the call in the pop-up open a tab in the "parent" window?
This behavoir is a browser setting, the user desides if he opens a new window or a new tab when he opens a link. You cannot manipulate this.
Only thing you can manipulate is if you open the link in a "blank" screen, current window or certain frame
They are both children of the original document and modal windows generally do not have children. They are the rough equivalent of modal dialogs in the Windows OS. In fact, that is what IE does; it even calls it a modal dialog. I think that what is being described here is a new browser instance and not a window with tabs.

How to Open many NEW windows in Javascript?

Wondering how to open many new windows with Javascript. I have found plenty of places on the internet that show you how to open a new browser window with Javascript, but I want to open a new UNIQUE window. For Example.
I have two links on a page. the user clicks on both links and they are both opened in the same window. I want each link to open a new window WITH JAVASCRIPT.
Another Example.
I just opened a window with javascript and I have a link inside my newly opened window. I click on the link and it opens in the same window. I want to pop it out of that window WITH JAVASCRIPT, NOT use the same window.
Help?
window.open('page.html','WindowTitle','width=400,height=200')
Like the previous poster said, you want window.open(...)
var WindowObjectReference = window.open(strUrl, strWindowName [, strWindowFeatures]);
https://developer.mozilla.org/En/DOM/Window.open
Make sure that you have different strWindowName for each call since that determines which window the URL is opened in.

Categories

Resources