Created
August 31, 2015 21:53
-
-
Save ryanjones/5bead810c5134b004c00 to your computer and use it in GitHub Desktop.
jsonp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function () { | |
$('[data-toggle="tooltip"]').tooltip(); | |
$('#membership-form').on('submit', function(e){ | |
var member = $( "input:first" ).val(); | |
e.preventDefault(); | |
$.ajax({ | |
method: "GET", | |
url: "https://api.ama.ab.ca/reward_dollars/promotions/3/contestants/"+ member +".jsonp", | |
jsonp: "callback", | |
dataType: "jsonp", | |
data: { | |
format: "json" | |
} | |
}).done(function( result ) { | |
if ( result["contestant"]["error"] == "" ) { | |
if ( result["contestant"]["claimed"] ) { | |
location = 'thanks-for-participating.html'; | |
} else { | |
location = 'thank-you.html'; | |
} | |
} else { | |
location = 'thank-you-for-participating.html'; | |
} | |
}); | |
}); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment