Click to See Complete Forum and Search --> : Frameless Popup Window...simple code
Biggn
12-04-2002, 02:29 PM
Hey everyone...the board is nice and I'm sure I'll get comfortable hanging around here learning some new skills. But for now I have objective I'm trying to figure out, the code is pretty simple:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Testing</title>
</head>
<BODY onload="myfunction()">
<script LANGUAGE=JavaScript>
function myfunction()
{
window.resizeTo(350,200);
window.moveTo(450,150);
}
</script>
TestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTe stingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTest ingTestingTestingTestingTestingTestingTestingTestingTesting</body>
</html>
This window will automatically launch when I preview it in the browser...well I want it to be frameless...I have seen the frameless script out there...and I dont need all that code for this to work...its something simple that I am missing. I also need it to resize on its own, for example if there was a picture that was 437 x 213...then the window will automatically go to that size etc...
Can someone help me out please, in the meantime I will be researching the problem, I appreciate it. Thanks.
Fred
Zach Elfers
12-04-2002, 02:39 PM
Is this what your looking for?
<script language="JavaScript" type="text/JavaScript">
if (window != top) top.location.href = location.href;
</script>
That will get rid of frames IF they are there. Hope that helps.:)
Biggn
12-04-2002, 02:55 PM
This is what the code looks like with what you gave me....
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Testing</title>
</head>
<BODY onload="myfunction()">
<script LANGUAGE="JavaScript" type="text/JavaScript">
if (window != top) top.location.href = location.href;
function myfunction()
{
window.resizeTo(350,200);
window.moveTo(450,150);
}
</script>
TestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTe stingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTest ingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestingTestin gTestingTestingTestingTestingTestingTestingTesting
</body>
</html>
I'm trying to get rid of IE's frame's/buttons etc...this isn't working...does it have to be inside my onload???
Also if anyone knows how to make this window automatically resize to what its opening up to....like I said in my first post...that would be appreciated as well....thanks.
Fred
Zach Elfers
12-04-2002, 03:03 PM
Just make that in a new script. It doesn't have to be in your current one.
Biggn
12-04-2002, 03:18 PM
This is not working zach...what other script are you wanting me to add to it...the script I have already launches the popup window immediately and places it in the right-hand corner....
When I preview in the browser I want it to launch a pop-up window immediately (no link for it)
then I want it to have no title bar (no IE title bar/buttons
etc...)
I also want it to resize to what ever information will be inside...Example: If there is a picture thats 700 x 550 I want the window to automatically resize to that picture exactly.
Thanks,
Fred
Biggn
12-04-2002, 03:56 PM
Any ideas guys?
I'm still researching and getting ideas...could I use the border property to get the IE title bar/buttons out of here?
Thanks,
Fred
radynski
12-04-2002, 03:58 PM
You cannot remove or add the toolbars that IE adds to it's windows once the window has been created. You must define those settings when you open the window. I assume that you are using a window.open() command to make this window (if not, seriously consider it). Just change your status parameter appropriately. And if I'm not mistaken, the default is not to display those bars.
A simple window.open('url.htm', 'WindowName', 'menubar=no,scrollbars=yes,resizable=yes,width=450,height=430'); should do the trick for you.
Charles
12-04-2002, 04:31 PM
Zach,
Be careful; top.location.href = location.href has the side effect of disabling the user's 'back' button. That fragment loads the document in the top frame but it adds an entry to the history list. Hit 'back' and you end up executing the fragment again. Use instead:
if (top.location.href != self.location.href) top.location.replace(self.location.href)
Zach Elfers
12-04-2002, 04:41 PM
Thanks Charles. I'll have to remember that in case I ever have to use this script.:)
Biggn
12-05-2002, 03:20 PM
Actually, heres what I ended up using instead...
window.open("docname","docTitle","height,width")
Fred
Oh and radynski yes you can do all that...
samnewberry
12-06-2002, 07:49 AM
Originally posted by Biggn
Actually, heres what I ended up using instead...
window.open("docname","docTitle","height,width")
Fred
Oh and radynski yes you can do all that...
I have a similar question out there regarding this very issue. I am using the same window.open("doc","doctitle","height,width") but I am looking to remove the Blue Windows Title Bar from the Web Browser. Any ideas on how to remove that? I've got the frameless window with no toolbars, scrollbars, etc. but I can't find anyway to remove that.
Thanks in advance to your help!
Sam
gil davis
12-06-2002, 08:00 AM
The window title bar is protected by browser security features. You are prohibited from opening a titlebarless window without a security certificate (very expensive) and the client's acceptance of that certificate to make you a "truested site".
samnewberry
12-06-2002, 08:48 AM
SSL certificate?? We are trying to do this on our Intranet...
I'm not sure if this is what you're looking for, but give it a try.
http://www.dynamicdrive.com/dynamicindex8/chromeless.htm
Biggn
12-06-2002, 10:42 AM
Sam:
You can accomplish the process you are attempting by combining the height and width properties with the word fullscreen. you will see below how I accomplished this:
NewWindow = window.open("DocName","Title","fullscreen",+var);
as you see we put fullscreen, in quotes and then the var represents a variable in which we loaded the height and width values. IE: var = "Height=200,Width=250"
Try this approach it should work for you.
norberto
12-06-2002, 06:38 PM
@pyro
... the frameless should be a bug in the windows browser. Any script with the framless window won´t work, when the user has the new XP - Upgrade: SP1
I removed all my frameless scripts therfore.
Hope it helps.