日期:2014-05-16 浏览次数:20813 次
$("#provinceOne").change(function(e){
$("#cityOne option").attr("hidden",true).html('');
e.preventDefault();
/*POST title to server*/
var provinceOne = $("#provinceOne").val();
$.ajax({
url: '<%=request.getContextPath()%>/mgr/places/findCitys',
type: 'POST',
contentType: "application/json;charset=UTF-8",
data: JSON.stringify({name:provinceOne}),
dataType: 'text',
success: function(data){
eval("cityOneArray="+data)
for(var i = 0 ; i<cityOneArray.length;i++){
$("#cityOne").append("<option>"+cityOneArray[i]+"</option>");
}
},error:function(){}
});
/* window.location.href=window.location.href; */
});
});
$("#provinceOne").change(function(e){
$("#cityOne option").attr("hidden",true).html('');
e.preventDefault();
/*POST title to server*/
var provinceOne = $("#provinceOne").val();
$.ajax({
url: '<%=request.getContextPath()%>/mgr/places/findCitys',
type: 'POST',
contentType: "application/json;charset=UTF-8",
//data: JSON.stringify({name:provinceOne}),
data: {name:provinceOne},//////该这样就行了,jq会自动转换的
dataType: 'text',
success: function(data){
eval("cityOneArray="+data)
for(var i = 0 ; i<cityOneArray.length;i++){
&n