ercantunc
asked on
stopPropagation() not working in Firefox
In IE this function works (shows the calendar and allow click outside to close the calendar)
but it does not work in FF. (The calendar do not appear) any ideas?
function showCalendarControl(textFi eld) {
if (!e) var e = window.event;
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();
calendarControl.show(textF ield);
}
but it does not work in FF. (The calendar do not appear) any ideas?
function showCalendarControl(textFi
if (!e) var e = window.event;
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();
calendarControl.show(textF
}
if not, then ask the developer for calendarControl ;)
do you have a link to share with us so we can test?
ASKER
Sure it runs, but I it is not possbile to share
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ok I got it but in your example you do not pass it
ith should be something like this right?
yourElement.onclick = doSomething(somethinghere? ) ;
ith should be something like this right?
yourElement.onclick = doSomething(somethinghere?
No, the event is automatically passed to the function.
ASKER
This works in IE but in FF gives "e is undefined error"
function showCalendarControl(textFi eld) {
calendarControl.show(textF ield);
}
function stopProp(e){
if (!e) var e = window.event;
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();
}
onclick="showCalendarContr ol(this);s topProp(); "
function showCalendarControl(textFi
calendarControl.show(textF
}
function stopProp(e){
if (!e) var e = window.event;
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();
}
onclick="showCalendarContr
ASKER
I corrected like this now there is no error but still do not work in FF
onclick="showCalendarContr ol(this);s topProp;"
onclick="showCalendarContr
try this
function stopProp(e) {
var event = e || window.event;
if (event.stopPropagation) {
event.stopPropagation();
} else {
event.cancelBubble = true;
}
}
ASKER
now it says event is undefined, IE works
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
function showCalendarControl(textFi
calendarControl.show(textF
}