Solved

self.location.href=window.open

Posted on 1998-09-14
5
1,795 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: 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

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

696 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