Why is my URL called in JavaScript opening as pop-up [duplicate] - javascript

This question already has answers here:
Open a URL in a new tab (and not a new window)
(33 answers)
Closed 8 years ago.
Browser settings vary for allowing popups and I want my URL which is called within a JavaScript function to open in a new tab and not be considered a popup.I am opening the url as:
window.open(my_global_link,'_blank');
In IE and FireFox, when I click on the image I get a notification Pop-up blocked and only by Allowing pop-up for the site the URL would open in a separate tab. How can I make it open in a separate tab and not consider it a pop-up?

It is a browser setting . try finding navigation options for new tabs in the browser you are using and set it to open in a new tab instead off a new window.

Related

window.open is opening a new tab with orgin/url [duplicate]

This question already has answers here:
window.open() simply adds the url to my current url
(4 answers)
Closed 4 years ago.
I have a button that is located inside iframe with url="loclahost:3000" for example.
I have an event on this button that should open a new tab with another url for example "www.google.com". But when I click the button I am getting the new tab opened with the following url "http://localhost:3000/www.google.com"
I am using a window.open('www.google.com") function in order to open the new tab.
How can I remove the "http://localhost:3000/" from the new tab url?
The best way to do so would be to use an absolute link, which cancels out any relativity the URL might have:
var url = "https://www.google.com";
window.open(url);
Here the https:// signifies it's a completely different page to the current page, so the browser should open that link, not try and find a file by that name.

Can't open chrome://something with window.open on Chrome [duplicate]

This question already has answers here:
Link to chrome:// url from a webpage
(2 answers)
How to open a page with information about the browser?
(2 answers)
Closed 4 months ago.
Good evening everyone,
I would like to open a window with javascript code.
Usually window.open works fine but the link I provide is chrome://gpu and when I do that, Chrome redirects me to the about:blank page. It happens only with chrome:// links, everything else works fine.
I may understand it is some security issue and Chrome blocks these links to be opened. Do you know if there is a workaround or a setting to allow Javascript to open chrome:// in a new window ?
Thanks a lot,
Clems4ever

Want to open in New Tab on IE8 [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Opening url in new tab
while i am doing window.open(),my page opended in new window,but i want it to be opened in newtab of my browser.
How can do that?
I'm 99% sure you can't. There might always be an exception for the Redmond browser, but for the rest in the browser-land you cannot affect how a new window is opened via ECMAscript (which is a good thing).
It's a browser setting.

Is there a way to open multiple links one by one into newtabs using javascript?

I need to open 5 or 6 new pages into seperate tabs through one click .
Is it Possible to do it through javascript that works on all browsers.
regards
Whether the new link is opened in a new tab or in a new window is handled by the user settings in the browser, so I do not think you can handle this in JavaScript.
Look for window.open to open 5 or 6 new windows.

How to Open the link in new tab [duplicate]

This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
Programmatically open new pages on Tabs
I have a link in my page and i want it to be opened in a new tab when the user clicks it?
That depends on the users browser settings. You can't control that as far as I know. All you can do is get it to open in a new windows, but if the user has his/her browser setup to open new windows in a new tab, it will do that.
So basically, the best you can do is open in a new window.
target="_blank"
i.e.
link text here
Most browsers treat a _blank target as opening in a new tab.
Set the target to _blank:
Use the target attribute set to _blank:
example
The exact behavior depends on the browser and user settings, so this is the best one can do.
This is considered bad practive because you (the web developer) is trying to control what the users browser is doing. It should be up to me how I want to open the link. Other than that lecture (and I understand that this may not be your decision), it doesn't seem that there is a way to do this.

Categories