0

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.

1
  • Thank you everyone for your prompt answers! I feel I may have been confusing with what I need though. If I am to use the "window.open('my_file.html');" , It just sets an endless look up constantly openeing itself over and over again. I need it to actually open just itself up in a new window, and not in a tab for internet explorer 8. As clarification, I ONLY need this to work with internet explorer 8, as that is the only possible browser to use at my work. Commented Sep 16, 2013 at 22:37

4 Answers 4

2

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

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, I understand what you mean, but this file is not opened with a link. It is opened from the desktop, as if it was a standalone program. I need it to place itself in its own window upon opening.
1

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.

Comments

1

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);

Comments

0

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

add the URL of the program and it should work

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.