1. 程式人生 > >ajax專案中的應用案例

ajax專案中的應用案例

@ajax的專案案例
$.ajax({
type: “GET”,
url: baseURL + “ship/shiptransfer/getshipTransfer”,
contentType: “application/json”,
data:{“transferId”:a},
success: function ® {
document.getElementById(“shipName”).value=r.shipName;
document.getElementById(“number1”).value=r.duration;
document.getElementById(“userSelects”).value=r.watcher;
document.getElementById(“transferDate”).value=r.transferDate;
document.getElementById(“targetType”).value=r.targetType;
if(r.targetType1){
$("#a").click();
document.getElementById(“updateports”).value=r.targetPortName;
}else if(r.targetType

2){
$("#b").click();
document.getElementById(“updateyards”).value=r.targetPortName;
}
document.getElementById(“reason”).value=r.reason;
}
});