jquery - How can I add more variables to this ajax post...? -
i making game , need send variables via post request leaderboards page.
this current post code:
var todatabase = confirm('do want save score database?'); if (todatabase) { $.post("leaderboards.php", {"level1": "level1"}, function() { window.location.href="leaderboards.php"; }); } else { $.post("gamel2.php", {"level1": "level1"}, function() { window.location.href='gamel2.php'; }); } this top code linking leaderboards.php file 1 wish add more variables too. how can done? add new pair of curly braces?
the 2nd parameter object:
$.post("leaderboards.php", {"level1": "level1", "abc": "def", "num": 123}, function() { just separate commas
Comments
Post a Comment