Monday, January 23, 2012

the better POST fix

The POST AJAX implementation here should really be like the following. The problem with what I had before was that I was STILL passing too much gunk in the URL line. Duh.

var url = "@ViewBag.WhereAmI";

url = url + "/home/validate";

var data = "value=" + content;

data = data + "&isRequired=true";

data = data + "&maxSize=5000";

var message = $.ajax({

   type: "POST",

   url: url,

   data: data,

   async: false

}).responseText;

No comments:

Post a Comment