SoundChaos
SoundChaos

Reputation: 307

Using open.window() to open js program in a new window

I have a program that is written in CSS/HTML/JavaScript all inline, and opened directly from the HTML file (no web URL). Right now, everyone I work with has their browser set to open any links in a new tab in the same window, which makes the program useless, as it is form that is filled out manually, meant to be on a second monitor.

Right now, I have the window.resizeTo(); and the window.moveTo(); functions working properly IF the open in tabs is changed to open links in new window, but I cant walk around doing that to over 500 computers (no exaggeration on the amount), not to mention, any changes to the settings are reset afte the computers are reset.

When I try the window.open();, it just opens up a blank page in a new window after the .html file is opened, I need it to open itself in a new window, and then resize/move after.

Upvotes: 0

Views: 245

Answers (4)

Starx
Starx

Reputation: 78961

Opening a page on tab or a separate window is browser specify feature, and it cannot be controlled by a Web Application.

window.open() will open a popup window and can open any URL you specify when provided:

window.open('openthispage.html);

Upvotes: 1

SLaks
SLaks

Reputation: 887215

You can pass a URL to window.open() to open that URL.
You can pass the current URL using location.href.

You can also specify a size and location directly in the third parameter.

Upvotes: 1

3dgoo
3dgoo

Reputation: 15794

Use window.open(...) with the height and width parameters set. This will force the link to open in a new window:

<a href="http://www.google.com" onclick="window.open(this.href, '_blank', 'location=yes,height=570,width=520,scrollbars=yes,status=yes');">Share Page</a>

Demo

Upvotes: 2

y0ruba
y0ruba

Reputation: 234

window.open(URL,name,specs,replace)

add the URL of the program and it should work

Upvotes: 0

Related Questions