|
-
Mar 8th, 2002, 06:36 AM
#1
Thread Starter
Addicted Member
openWindow
Hello,
I want to open another HTML file "FILE2.html" for example when a link in "File1.html" is clicked, and I want to control the appearance of the opened file "File2.html" to have no menubar, toolbar, and control its width or height, ... etc
I know that this is done by Javascript and here is the function to do it:
function OpenWindow(URL, Name)
{
open(URL,Name, "width=640,height=480,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=1,scroll bars=yes,status=0,toolbar=0")
}
but What I want is to transfer this code to the opened file, so I need not to run JavaScript in the source file "File1.html".
Can this be done?
-
Mar 8th, 2002, 08:33 AM
#2
-
Mar 8th, 2002, 09:23 AM
#3
Re: openWindow
Originally posted by bmarzouk
Hello,
but What I want is to transfer this code to the opened file, so I need not to run JavaScript in the source file "File1.html".
Can this be done?
Not sure i understand what you mean by transfareing the code. If you mean you want to use the javascript on the first file on the second file aswell, then its should be pretty easy.
Put the all the javascript code in a js file and included that file in your first and 2nd file
e.g
<script language=javascript src=myscript.js></script>
No you can use the same script in both page.
Hope this helps
Danial
[VBF RSS Feed]
There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.
If I have been helpful, Please Rate my Post. Thanks.
This post was powered by : 
-
Mar 8th, 2002, 09:36 AM
#4
Thread Starter
Addicted Member
control window appearance
Dear all,
I am sorry if I didn't explain what I want to exactly,
How can I control the appearance of a browser window displaying HTML page by code written in the same HTML page?
I hope it's now more clear,
Thanks
-
Mar 8th, 2002, 10:33 AM
#5
Hi,
I was just gonna reply saying no it cant be done, then just tried out something now and It works !! Only thing you need to add is close the inital window, i am working on it now.
Have a look at it.
Code:
<html>
<Head>
<Title>
Is It Possible?
</Title>
<script>
function winopen()
{
var url;
url=document.location.href;
pos=url.indexOf("AbC");
//i am adding this "AbC" to prevent an endless loop
//this will ensure that the page is only called once.
if (pos==-1)
window.open(url + "?AbC","test", "width=640,height=480,dependent=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=1,scrollbars=yes,status=0,toolbar=0") ;
}
</script>
</Head>
<Body onload="winopen()">
</Body>
</html>
You may have noticed i have added "AbC" string to identify if the page is called for the first time. This is not the best way as it might interfear if you using asp and querystring.
I was thinking if some how i could get the feature of the window, like if the window has toolbar, menu bar etc then it would be the best way.
Does anyone know if i can findo out if an window has a toolbar, menubar etc.
Thanks
Last edited by Danial; Mar 8th, 2002 at 10:38 AM.
[VBF RSS Feed]
There is a great war coming. Are you sure you are on the right side? Atleast I have chosen a side.
If I have been helpful, Please Rate my Post. Thanks.
This post was powered by : 
-
Mar 8th, 2002, 10:56 AM
#6
the only way you can control the appearance of a browser window is if you opened that window up with javascript. you will not beable to change teh users default window.function OpenWindow(URL, Name)
{
open(URL,Name, " width=640,height=480,fullscreen=0,location=0,menubar=0,resizable=1,scrollbars=yes,status=0,toolbar=0 ")
}
but if you want to have a containerless window (chromeless) you can go here and read up on it.
http://www.snippetlibrary.com/tutori...atname=Windows
or some code
http://www.snippetlibrary.com/code.p...catname=Popups
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|