HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 18th, 2001, 07:50 AM
bpp198 bpp198 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Location: UK
Posts: 27 bpp198 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Question

I understand that if you open a window using the window.open() function, giving the window a name 'win', and then open another window using the same window name, it replaces the content of that window.

This was happening fine on my computer, but all of a sudden, it would open another window instead of replacing the contents of the first window, even when the window names were the same.

Has anyone come across this problem before? Even better, has anyone found a way of fixing it?!!

Thanks,
Ben.

Reply With Quote
  #2  
Old February 18th, 2001, 09:22 AM
avivit avivit is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 136 avivit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 m 19 sec
Reputation Power: 8
Arrow syntax? Write the code

It happened to me. Few times.
And the problem was that something in the syntax of opening the window or in the "href" that was sent to the function that held the opening window javascript part,was not ok, so it was ignored.
Wanna write the code, so we'll see what's the problem?

Reply With Quote
  #3  
Old February 18th, 2001, 01:26 PM
bpp198 bpp198 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Location: UK
Posts: 27 bpp198 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks for replying.

The code is irrelevant because it has happened with code that has previously worked and now no longer works. For example, the following code:

window.open("http://www.site1.com/", "win");

should open site1.com in a new window. The next line:

window.open("http://www.site2.com/", "win");

should then replace it with site2.com - this is now no longer happening. It works in Netscape and works in the same version of IE (5.5) on another computer, so I believe the problem is not with the code, but with the software on my machine.

Really frustrating as it is seriously hindering my work!!

Regards,
Ben.

Reply With Quote
  #4  
Old February 19th, 2001, 02:15 AM
adios adios is offline
Senior Citizen
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2001
Location: leftcoast
Posts: 2,019 adios User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 10
You're misunderstanding the difference between the variable used to reference a window object in JavaScript and the HTML name of the window. Read this:

http://www.webreference.com/js/tips/000426.html

Reply With Quote
  #5  
Old February 19th, 2001, 02:56 AM
avivit avivit is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 136 avivit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 m 19 sec
Reputation Power: 8
Arrow Try some...

Adios, there is no misunderstanding here regarding what u mentioned. A variable is needed to do other things like closing windows, etc.But that is not the case here.

Those lines should work. If u replace "win" with "win2" for other links,different windows will be opened.

bpp198: I know u said that the code shouldn't be a problem, and so it seems.
I would still suggest u to send me the code to test, or
upload the file to the web and check if u r still having problem, so we can focus on the problem.

Maybe even try to check a site which does the same, and check if it's ok.
For exp. u can go to my site:
http://library.md.huji.ac.il/
there pick "electronic journals" in the menu,and there pick "journal list" in the sub menu.
Press on more than 1 link in the list of journals. They replace the same window.
Does it work for you?

I am paranoid. I check many things when having a probelm and when I don't know where to start from. So try it.
Bad things won't happen.

Inform us with your findings.

If it's software stuff, I know nothing about it.

Reply With Quote
  #6  
Old February 19th, 2001, 03:08 AM
avivit avivit is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 136 avivit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 8 m 19 sec
Reputation Power: 8
Arrow Forget about MY site. It's intranet

Sorry. I forgot. The part I sent u too in my site
is in INTRANET, so u can't access it.

Instead, copy the very following code to a new file of yours, and see if it works for u.

<html>
<head>
<title>Untitled</title>
</head>
<script language="Javascript">
<!--
var IE=false;
var NS=false;
if (navigator.appName=="Netscape")
{NS=true;
if (navigator.appVersion.charAt(0)>="5")
var NS6=true;
}
else if(navigator.appName=="Microsoft Internet Explorer")
IE=true;

var wind=""; var wind2="";
function winOpen(url) //Open new window according to link
{ if (IE||NS6)
{ window.open(url,"win");
}
else if (NS)
{ window.open(url,"win");
}
}

//-->
</script>
<body>

<a href="javascript:winOpen('http://www.yahoo.com/')">link1</a>
<a href="javascript:winOpen('http://www.md.huji.ac.il/')">link2</a>

</body>
</html>

Don't forget to inform us...

Reply With Quote
  #7  
Old February 19th, 2001, 04:57 AM
bpp198 bpp198 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Location: UK
Posts: 27 bpp198 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks all,

Tried the above code, but each link opens in a separate window. I am convinced there is something wrong with my computer now - I will have to try and reinstall IE... not an enviable task though!

Strange bug, don't know why it has suddenly started either.

Once again, thanks for all the replies.

Ben.

Reply With Quote
  #8  
Old February 20th, 2001, 12:06 PM
Wonderin' Wonderin' is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Posts: 5 Wonderin' User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Talking

Try adding onBlur="window.close()" to the body line of the page that is opening up.

Reply With Quote
  #9  
Old February 20th, 2001, 01:09 PM
bpp198 bpp198 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2000
Location: UK
Posts: 27 bpp198 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks, but this is more of a workaround than a solution. I don't want code on the pages that works only for my computer!

I guess I need to find a different forum for this question as it is not really a javascript issue anymore, but is a problem with my computer. Does anyone know anywhere I can go for help?

Ben.

Reply With Quote
  #10  
Old February 20th, 2001, 09:01 PM
Wonderin' Wonderin' is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Posts: 5 Wonderin' User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
http://discussions.virtualdr.com/cg...gi?action=intro

Not a bad place to start with windows probs...

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > Internet Explorer window problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT