Javascript Dhtmlx计划程序onEmptyClick无法访问IE8中的对象属性
我已经实现了Dhtmlx调度器,用于从网站进行预约。一切都很好,但在IE8中很少有方法不起作用 以下是我的onEmptyClick方法:Javascript Dhtmlx计划程序onEmptyClick无法访问IE8中的对象属性,javascript,jquery,dhtmlx-scheduler,Javascript,Jquery,Dhtmlx Scheduler,我已经实现了Dhtmlx调度器,用于从网站进行预约。一切都很好,但在IE8中很少有方法不起作用 以下是我的onEmptyClick方法: scheduler.attachEvent("onEmptyClick", function (date, native_event_object){ if(!$(native_event_object.target).hasClass('dhx_scale_holder')){ var s=confirm("Are you sure, You wan
scheduler.attachEvent("onEmptyClick", function (date, native_event_object){
if(!$(native_event_object.target).hasClass('dhx_scale_holder')){
var s=confirm("Are you sure, You want to take an appointment");
if(s){ // proceed appintment}
}
});
这是hasClass的问题。在其他浏览器上,它可以正常工作。但在IE8上,它返回未定义的本机\u event\u object.target,这导致了所有问题
它返回本机事件对象,我甚至可以在控制台中看到目标
你知道怎么解决这个问题吗?我知道了
IE不支持。目标。因此,我在代码之前添加checked
scheduler.attachEvent("onEmptyClick", function (date, native_event_object){
if(typeof native_event_object.target === 'undefined')
var currTarget=native_event_object.srcElement;
else
var currTarget=native_event_object.target;
if(!$(currTarget).hasClass('dhx_scale_holder')){
var s=confirm("Are you sure, You want to take an appointment");
if(s){ // proceed appintment}
}
});