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="javascript:modifypopup()">Modify</a>
modifypage.php
==============
(...)
if ($modifycheck != "true"
{
// display here the values to be modified
<form action=$PHP_SELF>
<input type=hidden name=modifycheck value="true">
<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 "mainpage.php?[php_vars]#line2", and scrolls to "line2", 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 ";" !), then it's reloaded. I don't understand this :/
A thing I must mention also, is that the "mainpage.php" is in a frame
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="javascript:modifypopup()">Modify</a>
modifypage.php
==============
(...)
if ($modifycheck != "true"
{
// display here the values to be modified
<form action=$PHP_SELF>
<input type=hidden name=modifycheck value="true">
<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 "mainpage.php?[php_vars]#line2", and scrolls to "line2", 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 ";" !), then it's reloaded. I don't understand this :/
A thing I must mention also, is that the "mainpage.php" is in a frame