Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Mozilla FireFox Issue

document.location with name tag is not working with FireFox

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

New User

10+ Year Member

joined:Apr 29, 2005
votes: 0

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?

$changeURL = $_POST['changeURL'];
if ($changeURL == 1)
echo <<<EOF
<SCRIPT TYPE="text/javascript">
window.location = window.location.href+'#uploadSection';
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<title>InterChange: Administrative Upload</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<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>

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

Senior Member

WebmasterWorld Senior Member tedster is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:May 26, 2000
votes: 0

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.
5:08 pm on Apr 29, 2005 (gmt 0)

New User

10+ Year Member

joined:Apr 29, 2005
votes: 0

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....