Questions tagged [window.open]

It is a JavaScript method that opens a new window and loads the document specified by a given URL.

window.open is a JavaScript method that opens a new browser window.

Syntax

window.open(URL,name,specs,replace)
1098 questions
505
votes
7 answers

JavaScript: location.href to open in new window/tab?

I have a JavaScript file from a third party developer. It has a has link which replaces the current page with the target. I want to have this page opened in a new tab. This is what I have so far: if (command == 'lightbox') { …
iamjonesy
  • 24,732
  • 40
  • 139
  • 206
181
votes
16 answers

Cannot open local file - Chrome: Not allowed to load local resource

Test browser: Version of Chrome: 52.0.2743.116 It is a simple javascript that is to open an image file from local like 'C:\002.jpg' function run(){ var URL = "file:///C:\002.jpg"; window.open(URL, null); } run(); Here is my sample…
KBH
  • 1,887
  • 2
  • 11
  • 11
118
votes
8 answers

Chrome, Javascript, window.open in new tab

In chrome this opens in a new tab: