Forum Moderators: open

Message Too Old, No Replies

Mozilla FireFox Issue

document.location with name tag is not working with FireFox

         

mindshare

2:53 pm on Apr 29, 2005 (gmt 0)

10+ Year Member



I have the follownig code to test our applications for changing the URL on a web page using document.location. When changing the location, the page should jump to the name tag defined in the page.

The code works great on IE without any problem however in FireFox I get a blank page. I look at the source code and it has all of the code for the page however the page does not get displayed unless I hit the refresh button.

Here is the code. Can someone help me?

<?php
$changeURL = $_POST['changeURL'];
if ($changeURL == 1)
{
echo <<<EOF
<SCRIPT TYPE="text/javascript">
window.location = window.location.href+'#uploadSection';
</SCRIPT>
EOF;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>InterChange: Administrative Upload</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<form name="testAnchor" method="post" action="testAnchor.php" enctype="multipart/form-data">
<input type="hidden" name="changeURL" value=1>
<input type="button" name="Test" value="Test" onClick="submit();return false;">
<input type="checkbox" name="TestCheckBox">
<a name="#uploadSection"></a>
</form>
</body>
</html>

tedster

3:13 pm on Apr 29, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Use <a name="uploadSection"></a> (without the #). The "#" is used only to separate the urls and the anchor name, but it is not part of the name itslef.

mindshare

5:08 pm on Apr 29, 2005 (gmt 0)

10+ Year Member



I thank you for the reply. I removed the "#" from the <a name = ""> </a> tag however it is the same issue.

When I use FireFox and click on the button, I only see a blank page. I do a view source and I see the entire source. After I refresh the page then it shows the page.

Please HELP....