本文介绍了Javascript函数挂起我的浏览器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好我已经在我的页面中按照脚本动态突出显示地图。它会给出结果,但是在加载页面后,我的所有浏览器都被吸了,或者被无限下吊。
Hi I have followin script in my page to highlight the map dynamically.It's gives result but after loading the page, all my browser get sucked, or infinitely hanged.
<script>
function highlight(list) {
var jsVariable = list;
var area = document.getElementsByTagName('area')
var ary = []
for (var zxc0 = 0; zxc0 < area.length; zxc0++) {
ary.push(area);
}
var isfound = false;
for (var i = 0; i < area.length; i++) {
isfound = false;
for (var j = 0; j < jsVariable.length; j++) {
var SpliData = jsVariable[i].trim().split(":");
if (area[i].getAttribute('title').trim() == SpliData[0].trim()) {
isfound = true;
$(area[i]).each(function ()//get all areas
{
$(this).addClass('Highlight_' + i)
var data = {};
$('.map').maphilight();
data.alwaysOn = true;
data.fillColor = SpliData[1];
$(this).data('maphilight', data).trigger('alwaysOn.maphilight');
});
}
if (!isfound) {
$(area[i]).each(function ()//get all areas
{
$(this).addClass("NoHighLight");
});
}
}
}
}
</script>
< / pre>
应该是什么原因?
FYU,浏览器在添加以下部分后开始挂起
</pre>
What should be the reason for that?
FYU, The browser starts to hang after adding the following part
$('.map').maphilight();
data.alwaysOn = true;
data.fillColor = SpliData[1];
$(this).data('maphilight', data).trigger('alwaysOn.maphilight');
由于此部分用于动态突出显示地图。
请帮帮我。
Since this part is used to highlight the map dynamically.
Please help me out.
推荐答案
这篇关于Javascript函数挂起我的浏览器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!