我正请求从服务器获取 html 代码 的一部分 。 服务器上有一个文件, 要为不同的要求打印 html 代码 。 我在此使用以下代码 :
function check(inf_type) {
$.ajax({
type: POST ,
url: "get_info.php",
data: { "sequence_no" : 1 },
success: function(data) {
// how can i use value of variable "inf_type" here.
// here, the variable "data" contains HTML code.
},
dataType: text
});
}
the function check() accepts a parameter inf_type which contains random strings according to which, server recognize the html code to print. Now, i want handle the POST response according to this inf_type. How can i access the value of inf_type variable in POST response function? The function check() is called more often, thats why i can not put the inf_type variable value in any global variable. What can i do to achieve that? Please guide me. thanks in advance.