Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/434.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript AspXClient文件列表上下文菜单“;e、 htmlEvent.y“的;不同的Internet Explorer具有不同的价值?_Javascript_Asp.net_Devexpress - Fatal编程技术网

Javascript AspXClient文件列表上下文菜单“;e、 htmlEvent.y“的;不同的Internet Explorer具有不同的价值?

Javascript AspXClient文件列表上下文菜单“;e、 htmlEvent.y“的;不同的Internet Explorer具有不同的价值?,javascript,asp.net,devexpress,Javascript,Asp.net,Devexpress,我使用了DevExpress的AspxTreeList控件 在客户端,我使用了ContextMenuEvent 我为右键单击检索e.htmlEvent.y值 问题是在IE8中,该值与IE11不同。为什么? 有解决办法吗?我找到了解决问题的办法 我检查IE的版本 function isIE () { var myNav = navigator.userAgent.toLowerCase(); return (myNav.indexOf('msie') != -1) ? parseInt(myN

我使用了DevExpress的AspxTreeList控件

在客户端,我使用了
ContextMenu
Event

我为右键单击检索
e.htmlEvent.y

问题是在IE8中,该值与IE11不同。为什么?


有解决办法吗?

我找到了解决问题的办法

我检查IE的版本

function isIE () {
 var myNav = navigator.userAgent.toLowerCase();
 return (myNav.indexOf('msie') != -1) ? parseInt(myNav.split('msie')[1]) : false;
}

if (isIE () == 8) {
  // IE8 code
} else {
  // Other versions IE or not IE
}

使用客户端ASPxClientUtils.GetEventX/ASPxClientUtils.GetEventY方法检索正确的值:

var x = ASPxClientUtils.GetEventX(e.htmlEvent);
var y = ASPxClientUtils.GetEventY(e.htmlEvent);