Solved

self.location.href=window.open

Posted on 1998-09-14
5
1,789 Views
Last Modified: 2006-11-17
can someone fix this code for me?

   <SCRIPT>
    var ie = (navigator.appName.indexOf("Microsoft") != -1 && 
         navigator.userAgent.indexOf("Windows 3.1") == -1 );
    if (ie) self.location.href = window.open('http://www.angelfire.com/oh/asacui/a.html', 'Sample', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,">


        else self.location.href = "http://www.angelfire.com/oh/asacui/a.html";

</SCRIPT>



-----------------------------
i basically want my page to have no directories or menu bar
as soon as you enter it.
i thought i would do this by popping up a new window without
the menu bar...
i would like to have no delay though...
no user interaction...
just a window that pops up by itself

p.s.
what is "copyhistory"?
0
Comment
Question by:dantelove
  • 2
  • 2
5 Comments
 
LVL 4

Expert Comment

by:martinag
ID: 1837618
Better?

var ie = (navigator.appName.indexOf("Microsoft") != -1 &&  navigator.userAgent.indexOf("Windows 3.1") == -1 );
if (ie)
  window.open('http://www.angelfire.com/oh/asacui/a.html', 'Sample', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,">
else
  location.href = "http://www.angelfire.com/oh/asacui/a.html";

Copyhistory? No idea.
Martin
0
 
LVL 8

Accepted Solution

by:
jbirk earned 60 total points
ID: 1837619
If you want to remove the directories and menu bar, I'm assuming that you want this to happen for all browsers not just IE on Win 3.1?  So you'll have to modify it to window.open for everyone, and you don't need to say "=no".  If you just leave it out the option is not included in the window.  Also "=yes" is not necesary either. So just:
window.open('http://www.angelfire.com/oh/asacui/a.html', 'Sample',
'scrollbars,copyhistory");

My guess for "copyhistory" is that it's supposed to copy the history object of the opening window to the new window.  So this way back, and forward would still have where've you've been in the new window.  But my book does not say that copyhistory exists so I have doubts as to whether or not it actually works.  try it and tell me, I'd be interested to know!

-Josh
0
 

Author Comment

by:dantelove
ID: 1837620
i tried the copy history experiment and it doesnt work

thanks for the other pointer
.
one more question though:

page"a" pops up page"b"...
and i have 2 windows:
window 1 is "a" and window 2 is "b"

.how can i make
window 1 change itself to window "b"?

so i have
window 1 and 2 both showing "b"
0
 

Author Comment

by:dantelove
ID: 1837621
oh, i figured out the answer to my last question:
<META HTTP-EQUIV="Refresh"....>
0
 
LVL 8

Expert Comment

by:jbirk
ID: 1837622
OK, I never actually understood your question in the first, but I'm glad you figured it out.
-Josh
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question