sammarks

jQuery POST Boilerplate-ish.

Jul 12th, 2011
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
jQuery 0.31 KB | None | 0 0
  1. $.post("[script URL]", {[variableName]:[variableValue], [variableName]:[variableValue]},
  2.     function(data) {
  3.         if (data["longerThan512"] == true) {
  4.             // ask(...) or w/e.
  5.         }
  6.     }, "json");
  7.  
  8. // Script returns JSON with a variable "longerThan512" - change if you wish.
  9. // Takes whatever variables, as defined above.
Advertisement
Add Comment
Please, Sign In to add comment