Click to See Complete Forum and Search --> : New guy with a (hopefully) simple problem.


efx
09-10-2004, 11:08 PM
Hello everyone, first time poster here.

I'll get right to it. I have this little page that has five links to it. When you click on a link it opens the page corresponding to the link in a little popup window. When you click on another link the script checks if a popup has already been opened and if so, it uses the already opened window.

The script works just fine in firefox but I get an error in IE, the "The remote server machine does not exist" error.

Here is the code.

<script>

var winpops = null;



function openpopup(url){



if(!winpops) {
winpops=window.open(url,"","width=100,height=110,");
} else {
winpops.location = url;
winpops.focus();
}

}
</script>


I'm very new at this so if anyone can tell me what's wrong with this I'd be most appreciative.

Thank you in advance:

Viktor

JesusWaffle
09-11-2004, 12:10 AM
Well, the script looks fine to me. What interests me is the error message. It suggests that the problem is not with the script, but with the server, or with communication between the server and the script. I'm not the best scripter in the world myself, and I have never experienced that type of thing before, so I couldn't tell you what was wrong.

Okay, tested your script myself; works fine on Firefox and IE. So it would appear that the script itself works fine. Your problem transcends the script and has something to do with the browser or the server. Sorry :( .

steelersfan88
09-11-2004, 07:11 PM
<script type="text/javascript">

function openpopup(url){
winpops=window.open(url,"popup","width=100,height=110");
}

</script>The second parameter of the window.open() is the name or target value. Setting the name to the same name of a previously opened pop-up from the same site (security issue), will result in the pop-up reloading in the same window.

On the otherhand, setting the value to "" will always open a new window, except in Navigator 4.x, which will always use the same window, with the name of "".

takato
09-11-2004, 07:32 PM
that's true, there's no need for a script
if the popup window has the same name as a new window, it'll refresh instead