jquery+Ajax如何获取返回值问题 在线等 急!!!!!
我想通过变量获得div "spanThis"的值在其他地方使用要怎么办?
前台html代码
<div id="spanThis"></div>
js代码
function selectCity(strCity,strName)
{
// 请求数据
$.ajax({
url: "setArea.aspx?city=" + strCity,
cache: false,
success: function(html){
if(html)
{
$("#spanThisArr").html(strName);
$("#spanThis").html(strName);
document.getElementById("jqmColseButton").click();
}
}
});
}
方法调用后得到的结果为 "北京"