选择Ajax响应对象以发送新请求

时间:2018-08-30 15:04:40

标签: javascript java jquery html ajax

我有一个如下的AJAX请求:

import UIKit

func BMIcalc (weight: Int, height: Int) -> Int {

    let BMI = weight/height

    if BMI > 25 {
        print ("you are overweight")
    }

    else if BMI > 18.5 && BMI < 25 {
        print("you are normal weight")

    else
    }

    return BMI
}

print (BMIcalc(weight: 60, height: 180))

根据输入数据($.ajax({ url: 'TypeState', type: 'POST', data: { state_name: name, city_type: type }, success: function(response) { alert(response.message); data = response.data; $('.tr').remove(); for (i = 0; i < response.data.length; i++) { $("#table").append("<tr class='tr'> <td> " + response.data[i].user_name + " </td> <td> " + response.data[i].user_contact + " </td> <td> " + response.data[i].user_license + " </td> <td> " + response.data[i].user_email + " </td> <td> " + response.data[i].state + " </td> <td> " + response.data[i].city); } }, error: function(response) { alert("unable to pull up any users for the selected state"); } }); state_name),我会得到很多用户对象响应,这些响应会附加到表中以显示在JSP页面中。

我希望让客户端能够选择其中一些用户对象并发送新请求。谁能告诉我该怎么做?

0 个答案:

没有答案