473,804 Members | 3,638 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why Doesn't This Work In Firefox?

Hello,

I am working on a mapping application where I need to be able to
determine the mouse cursor position on the browser screen. I have done
a lot of reading about this...apparent ly one should
use .pageX / .pageY for Firefox and e.clientX / e.clientY for Internet
Explorer.

In my page I have the following code segment. It works great for IE,
but it always hangs (does not advance to the next line of code) on
reference to .pageX or .pageY when using Firefox. The version I am
using is 2.0.0.11. This does not make any sense to me as every example
I have seen involves using .pageX and .pageY with Firefox.

What is causing it to hang?

function GetMouse(e)
{
if(!e) { e=window.event; }
//GETS TO HERE
if(!e || (typeof(e.pageX )!='number' && typeof(e.client X)!
='number')) { xcoord=0;ycoord =0; }
if(typeof(e.pag eX)=='number' && typeof(e.pageY) =='number')
{
//NEVER MAKES IT HERE
var xcoord=e.pageX;
var ycoord=e.pageY;
}
//OR HERE!
....more code...

Please tell me what I am doing wrong here. Thanks!
Jun 27 '08 #1
1 1320
jo*********@top scene.com escribió:
In my page I have the following code segment. It works great for IE,
but it always hangs (does not advance to the next line of code) on
reference to .pageX or .pageY when using Firefox. The version I am
using is 2.0.0.11. This does not make any sense to me as every example
I have seen involves using .pageX and .pageY with Firefox.
Current version is 2.0.0.14 so you've missed 3 updates :-?

What is causing it to hang?

function GetMouse(e)
{
if(!e) { e=window.event; }
//GETS TO HERE
if(!e || (typeof(e.pageX )!='number' && typeof(e.client X)!
='number')) { xcoord=0;ycoord =0; }
if(typeof(e.pag eX)=='number' && typeof(e.pageY) =='number')
{
//NEVER MAKES IT HERE
var xcoord=e.pageX;
var ycoord=e.pageY;
}
//OR HERE!
...more code...
I get an JavaScript exception but it doesn't hang in my computer:

e has no properties
if(typeof(e.pag eX)=='number' && typeof(e.pageY) =='number')

I suggest you enable automated updates and see if hanging persists.
Also, get Firebug extension so you can debug more easily.
--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://bits.demogracia.com
-- Mi web de humor al baño María: http://www.demogracia.com
--
Jun 27 '08 #2

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

Similar topics

6
3574
by: Cliff R. | last post by:
Hi, I use a handy little Javascript Flash detection script on a number of sites (copied below). Usually works great, but I just started trying Firefox and it's not working. A few browsers are referenced in the script so I presume that Firefox needs to be added somewhere -- does anyone know how I could update this to be supported by Firefox? Thanks! <SCRIPT TYPE="text/JavaScript">
3
2958
by: niconedz | last post by:
Hi The following code works fine in IE but not Firefox. It's a little script that zooms an image and resizes the window to fit. Can anybody tell me what's wrong? Thanks Nico == btw.. sorry for the long post ==
4
5108
by: Joe | last post by:
Hello, I have created a login page using dotnet. I am using requiredFieldValidator and noticed that the code works fine in IE but not in Netscape, Opera, Mozilla, Firefox, etc. For example if I do not enter anything in the form in IE, then form won't be submitted but in other browsers it is submitted. I checked that JavaScript is enabled in Netscape, Opera, Mozilla, Firefox,
4
3408
by: bbp | last post by:
Hello, In an ASPX page I have a "Quit" button which make a simple redirect in code-behind. This button doesn't work no more since (I think) I moved from the framework 1.0 to 1.1 and it doesn't work only on IE! My ASPX page works in FireFox. If the button doesn't work it's because of validators (and it worked with the same code in v1.0).
45
4752
by: Pat | last post by:
its seems asp.net validation doesn't fire when using FireFox? Tested a page and it doesn't fire. It seems the javascript doesn't fire Any ideas?
21
11416
by: briggs | last post by:
<html> <head> <script> /* AddChild */ function ac() { var c; var p = document.getElementById("p"); for (var i = 0; i < 5; i++) { c = document.createElement("DIV"); // Create 'div' element.
23
5388
by: wylbur37 | last post by:
I'm running an Apache server on my own computer (Windows XP Pro). I wrote a simple PHP script (called test3.php) that I'm running by putting the following URL in the address bar of the browser (Firefox) .... http://localhost/test3.php The script generates the following link using the echo statement ...
2
1519
bilibytes
by: bilibytes | last post by:
Hi, i have been creating an ajax aplication on my website and it worked as i expected it to work on Safari and Firefox, until i upgraded to Firefox 3. It doesn't work either on windows. the url is: http://www.whichselect.com I have created an event, that was triggered onmouseover the horizontal nav bar
7
2233
by: John Kotuby | last post by:
Hi all, I have created an ASPX page in VS 2008 that appears inside of an IFRAME inside a standard HTML page. Because it loads from an external site and is database driven, the first load takes a few seconds. As a result I have placed an absolutely positioned <DIVelement that is built into the HTML page that uses an animated GIF and a "Please Wait" message. When the IFRAME finishes loading a javascript function is called to change the...
1
10319
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10076
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9144
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7616
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6851
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5520
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3816
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.