hey thanks Kevin, does that even look like a valid function?
Truly, I am not even to the point where I am seeing if it will work, I am trying to figure out what $.ajax method does. I dont really understand what the various url: data: cache: fields do. Primarily the data:
I am trying to work off a website I found with this $.ajax method. data: {w:imgId, l:img2Id}, this throws me off.
- function postVote(imgId, img2Id) {
- // post vote
- $('#winningPup').show();
- $.ajax({
- url: '/ajaxincs/postvote.php',
- type: "POST",
- data: {w:imgId, l:img2Id},
- cache: false,
- error: function(res) {
- $('.error').html('<h3>Something went wrong</h3><p>Whoops, something wasn\'t right there, please refresh the page</p>');
- },
- success: function(data) {
- reloadBattlefield();
- $('#tweetWinner'+imgId).show();
- $('#winningPup').html(data);
- }
- });
- }