if (!json.count) {
var tmp = null;
$.each(json, function(i, item) {
$(o.ulProvince).append("<li id='" + item.id + "' >" + unescape(item.name) + "</li>");
tmp = document.getElementById(item.id);
tmp.onclick = function() { o.getCity(event, this); }
});
hid.style.display = hid.style.display = "block";
o.divAreaContent.style.display = "block";
}getCity 这个函数中火狐里不执行。
但是我不要event这个参数他就能执行。。
这个怎样搞的?
tmp.onclick = function(event) { var event = event || window.event; o.getCity(event, this); }
$.each(json, function(i, item) {
$(ulCity).append("<span id='" + item.id + "' class='leftinline' onmouseout='this.style.backgroundColor = \"#feffef\";' onmouseover='this.style.backgroundColor = \"#ffa22e\";' >" + unescape(item.name) + "</span>");
itm = document.getElementById(item.id);
itm.onclick = function() { o.cityLiClick(this); }
});这句子火狐里就怎么错了呢?
$(ulCity).append("<span id='" + item.id + "' class='leftinline' onmouseout='this.style.backgroundColor = \"#feffef\";' onmouseover='this.style.backgroundColor = \"#ffa22e\";' >" + unescape(item.name) + "</span>");
$(ulCity).append(" <span id='" + item.id + "' class='leftinline' onmouseout='this.style.backgroundColor = \"#feffef\";'就直接这句。。
恩。
alert("just test");
});上面的啥意思?
$(ulCity).append("<span class='leftinline' >" + unescape(item.name) + "</span>");
}
alert("2");
});我这样他照样不执行的。
我说下我的结构。。
首先是省的ul 点击 省之后 就出现 市的 ul ,他们的结构都是<div><ul></ul></div>. <div id="divAreaContent" style="display: none;" class="dragDiv">
<div id="dragDivHeader" class="dragDivHeader">
<ul id="ulSelectResult">
</ul>
<span id="closespan2" style="float: right; margin-right: 20px; cursor: pointer;">关闭</span>
</div>
<br />
<div id="divProvince" class="divProvince">
<ul id="ulProvince">
</ul>
</div>
</div>
<div id="cityArea" style="display: none; z-index: 5000;">
<ul id="ulCity">
</ul>
</div>
$(o.ulCity).append("<span class='leftinline' >" + unescape(item.name) + "</span>");
}
alert("2");
});o.ulCity 少了一个o
一天在csdn?