Solved

self.location.href=window.open

Posted on 1998-09-14
5
1,791 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

679 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