Page 1 of 1

Opening a new browser window from stand-alone .js file?

Posted: Fri Apr 04, 2003 10:46 pm
by spammich
I don't know if this is possible, but I'm building an Intranet app with php and I want to be able to have users click on a desktop icon that opens up IE with no toolbars or anything. From a web page I would just use code like this:

Code: Select all

window.open( "localhost/", "_blank",  "scrollbars=yes,toolbar=false,location=false,menubar=false", "" );
But when I put this code in a .js file and try to run in in windows I get a message that says 'window' is unspecified. I assume I need to 'import' some javascript library or perhaps create the window object first, but I'm not sure how to do this.

Thanks in advance for the help.

Posted: Sat Apr 05, 2003 4:25 am
by Skyzyx
Just make an HTML page (if that's what you're looking for...), and on that page do this:

Code: Select all

<script language="javascript" type="text/javascript">
<!--

window.resizeTo(width, height);

//-->
</script>

Posted: Mon Apr 07, 2003 11:11 am
by spammich
Is there away to get rid of the toolbars too? That's what I'm really looking to do.

Posted: Mon Apr 07, 2003 11:34 am
by d1223m
we've got the same problem on a project for winblows. the only answer we can think of is some code written in C/delphi/vb that directly opens a plain IE window.

The other soloution is to have the first html file open the window and then close itself. Not that you can close windows without the user being prompted but hey-ho-whaddaya-do?