Say I have the following code:
poNode = poEvent.target ? poEvent.target : poEvent.srcElement;
Is there a way I can force Internet Explorer to use the poEvent.target object?
Say I have the following code:
poNode = poEvent.target ? poEvent.target : poEvent.srcElement;
Is there a way I can force Internet Explorer to use the poEvent.target object?
Can you make firefox or any thing else for that matter understand what poEvent is, if it is, for whatever it is, first?!
Yeah, it's just like saying e.target or e.srcElement
Well, practically it is not!
poEvent is not "just like saying e.target" at all. In fact its just like stating 7 meaningless letters and let the browser guess what you were thinking.
Neither "e.target" has any meaning at all. You need to first define "e", because it is also undefined by default.
function eventHandler(e) {
e = e || window.event;
var target = e.target || e.srcElement;
/*
the rest of your handler here
*/
}
This and more good tips here: http://javascript.crockford.com/style2.html
Airshow
function eventHandler(e) { e = e || window.event; var target = e.target || e.srcElement; /* the rest of your handler here */ }
This and more good tips here: http://javascript.crockford.com/style2.html
Airshow
or better say:
function curent_poNode(){
poNode = event.srcElement;
}
now you can use your "poNode" to reference any event-source-element of the document, on browsers including: IE*; Chrome*; Opera*; Safari*; -excluding FF only.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.