jQuery UI选项卡-在IE10及更低版本中激活不返回'UI'的事件

jQuery UI选项卡-在IE10及更低版本中激活不返回'UI'的事件,jquery,jquery-ui,internet-explorer,jquery-ui-tabs,Jquery,Jquery Ui,Internet Explorer,Jquery Ui Tabs,我在一个页面上使用jqueryui。使用,函数内部应该有两个可用对象,事件和用户界面。在Chrome、Firefox、Safari和Internet Explorer 11中,ui对象已满。然而,在IE10及更低版本中,对象大部分是空白的。我的面板上有数据属性,用于激活我需要通过ui对象访问的每个选项卡中的特定内容,但这些属性在IE10及更低版本中都会失败 考虑以下代码: <script> $(document).ready(function() { $('#communit

我在一个页面上使用jqueryui。使用,函数内部应该有两个可用对象,
事件
用户界面
。在Chrome、Firefox、Safari和Internet Explorer 11中,
ui
对象已满。然而,在IE10及更低版本中,对象大部分是空白的。我的面板上有
数据
属性,用于激活我需要通过
ui
对象访问的每个选项卡中的特定内容,但这些属性在IE10及更低版本中都会失败

考虑以下代码:

<script>
$(document).ready(function() {
    $('#community-areas').tabs({
        activate: function(event, ui) {
            console.log(ui.newPanel[0].dataset.latitude);
            console.log(ui.newPanel[0].dataset.longitude);
        }
    });
});
</script>

<div id="community-areas">
    <ul>
        <li><a href="#tab-1">Tab 1</a></li>
        <li><a href="#tab-2">Tab 2</a></li>
    </ul>
    <div id="tab-1" data-communityid="water" data-latitude="29.266" data-longitude="-81.1379"></div>
    <div id="tab-2" data-communityid="break" data-latitude="29.0516" data-longitude="-81.029"></div>
</div>
有没有人见过这种行为并知道如何应对


如果还有类似的问题,我很抱歉。带有“ui”的Google搜索模糊了结果,因为“ui”位于“jQuery ui”中。

只有IE>=11才支持
dataset
属性,对于较旧版本的支持,请改用jQuery
data

参考:

代码:


演示:

谢谢!jQuery的
数据
成功了。我不知道我怎么会忽视这一点。
{"oldTab":{"0":{},"length":1,"prevObject":{"0":{},"1":{},"2":{},"3":{},"4":{},"length":5,"prevObject":{"0":{},"length":1,"prevObject":{"0":{},"length":1,"prevObject":{"0":{},"context":{},"length":1},"context":{},"selector":"ol,ul"},"context":{}},"context":{},"selector":"> li:has(a[href])"},"context":{}},"oldPanel":{"length":0,"prevObject":{"0":{},"context":{},"length":1},"context":{},"selector":"#tab-2"},"newTab":{"0":{},"length":1,"prevObject":{"0":{},"context":{},"length":1},"context":{}},"newPanel":{"0":{},"length":1,"prevObject":{"0":{},"context":{},"length":1},"context":{},"selector":"#tab-1"}}
$(document).ready(function () {
    $('#community-areas').tabs({
        activate: function (event, ui) {
            console.log($(ui.newPanel[0]).data('latitude'));
            console.log($(ui.newPanel[0]).data('longitude'));
        }
    });
});