?
Solved

self.location.href=window.open

Posted on 1998-09-14
5
Medium Priority
?
1,797 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 180 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

764 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