Solved

self.location.href=window.open

Posted on 1998-09-14
5
1,782 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
oh, i figured out the answer to my last question:
<META HTTP-EQUIV="Refresh"....>
0
 
LVL 8

Expert Comment

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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
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.
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 …

763 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now