cavtel
asked on
Not implemented error in IE
Hi,
I'm having this problem just for IE (I'm using IE8). The code works fine in all the other browsers (Firefox, Safari, Chrome). Here is a snippet
// I've a div with id='div_a'
window.onload = function() {
var elem = document.getElementById('d iv_a');
elem.onclick = dosomething(elem);
}
function dosomething(obj) {
if( !obj ) return;
obj.onmousedown = function() {
// doing something over here
}
}
Please note that window.onload is actually pointing to a function object. It is the same as doing the following (which yielded the same 'Not implemented' error in IE):-
window.onload = init;
function init() {
var elem = document.getElementById('d iv_a');
elem.onclick = dosomething(elem);
}
I'm having this problem just for IE (I'm using IE8). The code works fine in all the other browsers (Firefox, Safari, Chrome). Here is a snippet
// I've a div with id='div_a'
window.onload = function() {
var elem = document.getElementById('d
elem.onclick = dosomething(elem);
}
function dosomething(obj) {
if( !obj ) return;
obj.onmousedown = function() {
// doing something over here
}
}
Please note that window.onload is actually pointing to a function object. It is the same as doing the following (which yielded the same 'Not implemented' error in IE):-
window.onload = init;
function init() {
var elem = document.getElementById('d
elem.onclick = dosomething(elem);
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
HOWEVER I would not try to sset the onmousedown event handler in an onclick event. That is asking for trouble
So why a "B" ?
ASKER
My apologies. I thought I had clicked on 'A' and soon I realized my mistake. I don't think it is possible to re-assign a grade? or is it?
No problem. Unaccepted
ASKER
I was originally trying to execute a mousedown event when the user triggered a onclick event. But I agree it's better not to mix different event triggers with one another. That's what I ended up doing anyway.