473,789 Members | 2,501 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Compatability Between IE and Netscape (Event Property?)

What is the equivalent of

if (window.event.s rcElement.id == "txt1ST_INIT_NM ")

in Netscape?
Jul 20 '05 #1
2 1275
DU
Ron D wrote:
What is the equivalent of

if (window.event.s rcElement.id == "txt1ST_INIT_NM ")

in Netscape?


if(evt.target.i d == "txt1ST_INIT_NM ")
in NS 6+, Mozilla-based browsers, in Opera 7.x and in all other W3C DOM
2 Events compliant browsers.

We would also need to see your code, script function to implement an
event listener. Also, depending on your code (capture mode or bubbling
up) and how complex it is, you might be forced to use
evt.currentTarg et.id instead.
It's impossible to say more without being able to actually examine your
whole code.

DU
Jul 20 '05 #2
du*****@rrb.gov (Ron D) writes:
What is the equivalent of

if (window.event.s rcElement.id == "txt1ST_INIT_NM ")

in Netscape?


In Netscape 6+ (and other W3C DOM 3 Events compliant browsers, as well
as in Nescape 4) the event object is an argument to the event handler
function. In IE, it is a global variabled called "event". So, there is
no direct substitute for the above, because you have to add an argument
to the handler function.

I usually start my handlers with :

function (evt) {
evt = evt || window.event; // IE sucks!

Further, the "srcElement " is Microsoft's invention, where the W3C DOM
calls it "target". So I usually follow up with:

var tgt = evt.target || evt.srcElement; // IE sucks!

From here, you can just write:

if (tgt.id == "txt1ST_INIT_NM ") ...

Good luck.

/L 'yes, I write the comments every time too'
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleD OM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #3

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

Similar topics

6
11489
by: adrien | last post by:
Hi, (also posted in netscape.public.mozilla.browser) i use netscape 7 and want to hide the scrollbars of the window when something happens. I tried this: window.scrollbars.visible=false window.scrollbars.visibility="no" .... nothing works Is it also possible only to hide the vertical scrollbar instead of both?
2
3097
by: Phil | last post by:
Hello all ! I need help with this script : It's a tooltip appearing onMouseOver on a link. It works fine in IE, Opera but not Netscape 7 and Mozilla 1.5. The tooltip sticks on the top left corner of the window. Any help appreciated :-) Thanks
2
1889
by: Kevin Ly | last post by:
Consider the test case below. The onmouseout event does NOT fire when my mouse/cusor is moved off the left side of the browser. It does if it is moved off the top, bottom, and the right side that HAS THE SCROLLBAR (does not if the right side does not have the scrollbar on). Also, if you move around each "this is a test" line, the onmouseout event fires. How odd? Fortunately, I can have logic to handle this. The big problem is why...
2
1080
by: Lynn | last post by:
I am having a total nightmare trying to get Netscape to behave as IE does. Is there a good document anywhere on javascript/jscript and netscape compatiability? I have searched high and low and am getting nowhere fast. Particular issues: Use of innerHTML - is it supported? Onclick - seems to be getting ignored
2
1705
by: lawrence | last post by:
I thought I was fighting a PHP problem, so I asked about this on a PHP list, but they felt it was a Javascript problem, so I'm reposting a bit of the debate here. Could this Javascript, below, possibly trigger a redirect in Netscape, and send the browser to a file called "0". Cause what is happening is on load, in Netscape, the page redirects to something like: http://www.myDomain.com/0
26
2206
by: Roger Desparois | last post by:
Hi, I need help : I found the simplest and most precise way to open and close submenu layers. it works perfectly with IE, but for some odd reason NS won't recognize it. Can anyone tell me why ? And is there a way around the problem ?
4
1396
by: WStoreyII | last post by:
I know that the main two browsers are ie and netscape. However, how do i know if browsers like aol and other abstract browser put out by isps like sbc and earthlink are compatable with asp.net. I would hate to make web pages that can not be viewed by customers using these mediums as most people who use computers in a more entertainment light use these generic browsers. WStoreyII
1
2600
by: Jordan | last post by:
I set the cursor property to change to the "hand" when the user performs an "onmouseover" event on a hyperlink object. This does work correctly with Internet Explorer, however, with Netscape and Firefox, the cursor is just the "vertical line." Does anyone know why this isn't working with Netscape or Firefox? Thanks!
4
1197
by: andycain | last post by:
Hello guys. Developing a site using XTHML 1.0 Strict Doctype with CSS and I'm getting problems with getting the site to display properly in Firefox, Opera, Netscape and IE. Thing is it displays fine (or how I want it to) in IE but in Firefox, Opera and Netscape I get a problem with the margins around my DIVs. In the last three browsers (Firefox,Opera and Netscape) the site displays exaclty the same which leads me to believe that IE is...
0
9657
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9502
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10189
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10132
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
9010
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...
0
6754
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
5544
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3688
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2902
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.