473,425 Members | 1,834 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,425 software developers and data experts.

Firefox and Javascript location problem

I've been working on making my ASP.NET web apps compatible with Firefox (the
uplevel configs for web.config are a real help).

However, one really weird thing is a GotoAnchor() function I have (server
side), which injects javascript along the lines of:

location = '#buttons';

I use this so that, following postback, I can just back down to the relevant
part of the page.

It works fine in IE, but not in Firefox! Furthermore, I seem to loose other
Javascript injected following it (it's not simply malfunctioning, it's not
rendered by .NET!).

Any ideas why this is happening? Maybe a second postpack?

I can work around it by only emitting the javascript with IE - it's not the
end of the world. But a way to get similar functionality on Firefox would be
great.

Thanks,

John
Nov 19 '05 #1
2 1803


John wrote:

However, one really weird thing is a GotoAnchor() function I have (server
side), which injects javascript along the lines of:

location = '#buttons';
Try whether
window.location.hash = '#buttons';
works better.
It works fine in IE, but not in Firefox! Furthermore, I seem to loose other
Javascript injected following it (it's not simply malfunctioning, it's not
rendered by .NET!).

Any ideas why this is happening?


What does the Firefox JavaScript console show? Any error messages?

--

Martin Honnen
http://JavaScript.FAQTs.com/
Nov 19 '05 #2
Great, thanks! 'window.location.hash' solves the problem.

My original command must have been causing Firefox to reload the page a
second time following postback - there wern't any errors in the page, just a
lack of injected javascript!

I've now got full Firefox functionality (don't try saying that after a few
beers).

John
"Martin Honnen" <ma*******@yahoo.de> wrote in message
news:uf**************@tk2msftngp13.phx.gbl...


John wrote:

However, one really weird thing is a GotoAnchor() function I have (server
side), which injects javascript along the lines of:

location = '#buttons';


Try whether
window.location.hash = '#buttons';
works better.
It works fine in IE, but not in Firefox! Furthermore, I seem to loose
other Javascript injected following it (it's not simply malfunctioning,
it's not rendered by .NET!).

Any ideas why this is happening?


What does the Firefox JavaScript console show? Any error messages?

--

Martin Honnen
http://JavaScript.FAQTs.com/

Nov 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Geoff | last post by:
When trying to focus a field in Firefox, I get the following error: Error: " nsresult: "0x8057001e (NS_ERROR_XPC_JS_THREW_STRING)" location: "JS frame ::...
4
by: Stuart Perryman | last post by:
Hi, I have the following code which works just fine in IE6 but not in Firefox. It is an extract of several table rows each with an individual form. It is generated by php. <form...
3
by: David Hayes | last post by:
I've made tooltips work in Firefox*, but tooltip doesn't appear at the specified location until the SECOND time that the user passes the mouse over the location with the mouseover event. What I...
3
by: jimmygoogle | last post by:
I posted earlier with a scope problem. I think I resolved it in IE but in Firefox it still exists. Anyone have any ideas/experience with this? I attached my code sorry it is so long. You can...
5
by: Martin Chen | last post by:
I have a frame set (as per MS FrontPage 2000). It has a contents and a main frame. The contents frame has a menu bar written with with javascript (in the context of a table). In IE6.1 everything...
8
by: johnsonholding | last post by:
Here is the code for a pop-up window that works in Firefox and not in IE - I get a java error or something, Here is the code : </script> <SCRIPT language="JavaScript"...
4
by: petermichaux | last post by:
Hi, I'm hoping for a reason I'm wrong or an alternate solution... I'd like to be able to dynamically include some javascript files. This is like scriptaculous.js library but their solution is...
4
by: evgenyg | last post by:
Hello ! We have the following situation - when Ajax request is sent what's being returned by the server is usually an XML (which is used for DOM updates) but sometimes it's HTML which is a whole...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.