我经常遇到一个问题,即我无法利用亚克斯成功数据来履行另一项职能。 (单位:千美元)
$("#addproperty_state").keyup(function(){
var vardata = $(this).val();
var urlPro ="<?php echo HTTP_PHP; ?>ajax_common.php?action=get_area&area="+vardata;
$.ajax({
type: "POST",
url: urlPro,
dataType: "text",
async:false,
success: function(data) {
$( #statelist ).html(data);
}
});
return false;
});
我现在要利用亚克斯呼吁的结果,以便我能够把另一个具有结果价值的文字箱放在一起。
$("#statelist li").click(function(){
var statename = $(this).attr("title");
$("#addproperty_state").val(statename);
});
but if i was now to click on the li nothing happens. How can i use the ajax result to actually do something else with it? Any assistance would be greatly appreciated. Thank you