ajax parameters,Problem with jQuery ajax parameters

  • Post author:
  • Post category:其他


I’m sending a date to my webservice in this format: 12/14/2010 but the “/” character is causing the posted value to be something like 0.0323483238432834. How do I literally send the date in that format? Heres the ajax code I use:

function createNewPromo() {

var a = $(“#txtDateStart”).val();

var b = $(“#txtDateEnd”).val();

$.ajax({

type: “POST”,

url: “/WebService_VehicleDisplay.asmx/createNewPromo”,

data: “{startDate:” + a + “,” + “endDate:” + b + “}”,

contentType: “application/json; charset=utf-8”,

dataType: “json”,

success: function (msg) {

var response = msg.d;

},

failure: function (msg) {

alert(‘failure’);

}

});

}

Edit: here is what firebug says. endDate/startDate are my parameters.(this is what is being posted to my web service.).

JSON

endDate

0.00021321961620469082

startDate

0.00028429282160625445

Source

{startDate:12/21/2010,endDate:12/28/2010}