Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 17th, 2012  |  syntax: None  |  size: 0.37 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. passing a array to php via ajax?
  2. var car = new Array();
  3. car['brand'] = "Ford";
  4. car['color'] = "red";
  5. car['type'] = 1;
  6.        
  7. $.post('regCar.php', { "car[]": car }, function(data) {
  8.  
  9.     // some other lol here ...
  10.  
  11. });
  12.        
  13. var car = {};
  14.        
  15. var car = {};
  16. car.brand = "Ford";
  17. car.color = "red";
  18. car.type = 1;
  19.        
  20. var car = {};
  21. car.brand = "Ford";
  22. car.color = "red";
  23. car.type = 1;