Question:You want to use the .ajax() method to call a web method named GetCityCodes. This web method is contained on the same webpage as the jQuery code and UI markup. This method should be called by using JSON. The web method takes the state parameter. Which of the following calls would you use? 

A 
$.ajax({
type: "POST",
dataType: "json",
contentType: "application/json",
url: "CityLookup.aspx/GetCityCodes",
data: "{'state': '" + state + "'}",
success: function (data) {
alert(data.d);
},
 

B 
$.ajax({
type: "POST",
dataType: "json",
contentType: "application/json",
url: "CityLookup.asmx/GetCityCodes",
data: "{'state': '" + state + "'}",
success: function (data) {
alert(state.d);
},
 

C 
$.ajax({
type: "POST",
dataType: "json",
contentType: "application/json",
url: "CityLookup.aspx/GetCityCodes/" + state,
success: function (data) {
alert(data.d);
},
 

D [/code] $.ajax({ type: "POST", dataType: "json", contentType: "application/json", url: "CityLookup.asmx/GetCityCodes", data: "state:" + state, success: function (data) { alert(data.d); }, [/code] 

+ Answer
+ Report
Total Preview: 968

Copyright © 2024. Powered by Intellect Software Ltd