The following code achieves what I think you're looking for. [color="#1C2837"][size="2"]It uses jQuery and it should work for all decent browsers.[/size][/color]
$("#x").html("Page X: " + e.pageX);
$("#y").html("Page Y: " + e.pageY);
To answer your question, there are two ways to go about browser compatibility.
Technically, you could use [font="Courier New"]$.browser[/font] to detect the browser and [font="Courier New"]$.getScript [/font][font="Arial"]to load a different script depending on the browser. However, [url="http://css-tricks.com/2090-browser-detection-is-bad/"]browser detection is generally considered to be a bad idea[/url]. [/font]
[font="Arial"]The alternative is to test whether the features you need are supported ([url="http://quirksmode.org/js/support.html"]article[/url]). There are many ways of detecting whether a feature is supported, including [url="http://api.jquery.com/jQuery.support/"]jQuery.support[/url][/font] "If you always use object detection, your scripts will never generate any error messages, although they might not work in certain browsers."
I hope I've been able to help [img]http://public.gamedev.net/public/style_emoticons/default/smile.gif[/img]