Hello All,
please help me solve a small problem...
I use a simple JavaScript for opening, resizing and positioning of a new window.
The script goes like this:
<SCRIPT LANGUAGE="javascript">
<!--
function
{
OpenWindow=window.open ("", "newwindow", "height=400,
width=470, toolbar=no, menubar=no, scrollbars=yes, resizable=yes,
location=no, directories=no, status=no")
}
-->
</SCRIPT>
The link to the new window looks like this:
<a href=http://www.webdeveloper.com/forum/archive/index.php/"secondary_page.html" target="_blank" onClick="window.open(this.href,'secondary_page', 'width=470, height=400, left=100, top=100, screenX=100, screenY=100, scrollbars=yes, resizable=yes'); return false">Go to secondary page</a>
At the bottom of the new ("secondary") page there is either a normal "Close window" button
<FORM onSubmit="self.close();return false">
<INPUT TYPE=SUBMIT VALUE=http://www.webdeveloper.com/forum/archive/index.php/"Close window">
</FORM>
or a text command:
<div align="center"><a href="javascript:window.close();">Close window</a>
Now... If I want people - after they have viewed the secondary page - to return to the primary page, they just click on the "Close window" button or the text command above and they're back there where they came from and everything is just fine.
If, however, the secondary page (it was resized, remember?) was the entry page to which a visitor came through a search engine and he/she presses the "Close window" button, they're just nowhere...
Or, in such case, if I want to redirect that visitor to the "parent page" (the page he/she should have actually come from) and use a normal link like this:
<a href=http://www.webdeveloper.com/forum/archive/index.php/"primary_page.html">Close window</a>
instead of "Close window" button, then the parent page opens up resized and unnecessary positioned, i.e. repeating the size and position of the "secondary page" the visitor has just left...
I have also tried to use a "link button" like this:
<input type="button" value="Close Window" onclick="location='primary_page.html'">
instead of "Close window" button but, alas, to no avail - the "parent page" opens up resized and positioned as well...
Please excuse me for such a long explanation of my problem...
So the actual question is this:
If I have a resized and positioned window being the first window viewed, and I want people to both leave that page by clicking on the "Close window" button AND (on the same click!) redirect them to the "parent page", how do I get rid of those size and screen position parameters used in the "secondary page" when the "parent page" opens?
Any help will be greatly appreciated!
Valery
please help me solve a small problem...
I use a simple JavaScript for opening, resizing and positioning of a new window.
The script goes like this:
<SCRIPT LANGUAGE="javascript">
<!--
function
{
OpenWindow=window.open ("", "newwindow", "height=400,
width=470, toolbar=no, menubar=no, scrollbars=yes, resizable=yes,
location=no, directories=no, status=no")
}
-->
</SCRIPT>
The link to the new window looks like this:
<a href=http://www.webdeveloper.com/forum/archive/index.php/"secondary_page.html" target="_blank" onClick="window.open(this.href,'secondary_page', 'width=470, height=400, left=100, top=100, screenX=100, screenY=100, scrollbars=yes, resizable=yes'); return false">Go to secondary page</a>
At the bottom of the new ("secondary") page there is either a normal "Close window" button
<FORM onSubmit="self.close();return false">
<INPUT TYPE=SUBMIT VALUE=http://www.webdeveloper.com/forum/archive/index.php/"Close window">
</FORM>
or a text command:
<div align="center"><a href="javascript:window.close();">Close window</a>
Now... If I want people - after they have viewed the secondary page - to return to the primary page, they just click on the "Close window" button or the text command above and they're back there where they came from and everything is just fine.
If, however, the secondary page (it was resized, remember?) was the entry page to which a visitor came through a search engine and he/she presses the "Close window" button, they're just nowhere...
Or, in such case, if I want to redirect that visitor to the "parent page" (the page he/she should have actually come from) and use a normal link like this:
<a href=http://www.webdeveloper.com/forum/archive/index.php/"primary_page.html">Close window</a>
instead of "Close window" button, then the parent page opens up resized and unnecessary positioned, i.e. repeating the size and position of the "secondary page" the visitor has just left...
I have also tried to use a "link button" like this:
<input type="button" value="Close Window" onclick="location='primary_page.html'">
instead of "Close window" button but, alas, to no avail - the "parent page" opens up resized and positioned as well...
Please excuse me for such a long explanation of my problem...
So the actual question is this:
If I have a resized and positioned window being the first window viewed, and I want people to both leave that page by clicking on the "Close window" button AND (on the same click!) redirect them to the "parent page", how do I get rid of those size and screen position parameters used in the "secondary page" when the "parent page" opens?
Any help will be greatly appreciated!
Valery