Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

pener reloading

Status
Not open for further replies.

Bix78

Programmer
Jul 26, 2002
6
CL
Hello all,

I have already posted a thread about this but it was a bit long and not easily understandable, so here is it again :

How can I reload an opener, from a child window, and set this opener to a specific anchor (or whatever this "#" sign is called ;)) ?

This is simplified code (don't mind PHP syntax hehe) :

mainpage.php
============
(...)
function modifypopup()
{
window.open("modifypage.php?[php_vars]","modify","[size,location,and toolbars options]");
}
(...)
<a name=line2>
// data line here
<a href=&quot;javascript:modifypopup()&quot;>Modify</a>

modifypage.php
==============
(...)
if ($modifycheck != &quot;true&quot;)
{
// display here the values to be modified
<form action=$PHP_SELF>
<input type=hidden name=modifycheck value=&quot;true&quot;>
<input type=submit>
</form>
}
else
{
// Here : MySQL commands to update the database accordingly
<script language=Javascript>
window.opener.location='mainpage.php?[php_vars]#line2';
</script>
}


The mainpage's URL changes to &quot;mainpage.php?[php_vars]#line2&quot;, and scrolls to &quot;line2&quot;, but is NOT reloaded.

I tried reload() and replace() methods, but they don't seem to work.


If I change the line to :

window.opener.location='mainpage.php?[php_vars]'

(yes without the &quot;;&quot; !), then it's reloaded. I don't understand this :/

A thing I must mention also, is that the &quot;mainpage.php&quot; is in a frame




 
Grr I self-deleted the &quot;O&quot; in the title...

it's &quot;Opener reloading&quot; of course ;)
 
Bix78,

how about just doing both?

window.opener.location='mainpage.php?[php_vars]'
window.opener.location='mainpage.php?[php_vars]#line2'


======================================

if (!succeed) try();
-jeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top