Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //AJAX Functions
- // Sending the data
- function twitterSubmit(){
- var url = 'templates/twitterAjax.php';
- var pars = 'tUsername='+$F('twitterUsernameInput')+'&tPassword='+$F('twitterPassword')+'&tPreference='+$F('twitterPostAnEpisode');
- var failure = function() {alert('Something went wrong!')}
- //var myAjax = new Ajax.Updater(target, url, {method: 'get', parameters: pars});
- new Ajax.Request(url, { method:'get', parameters: pars, onSuccess: twitterSuccess, onFailure: failure });
- }
- // Successful returns
- function twitterSuccess(response) {
- if(response != undefined ) {
- console.log(response.responseText);
- var jsonarray = response.responseText.evalJSON(true);
- console.log(jsonarray);
- } else {
- console.log('oops! Success was actually failure. Close but no cigar.');
- }
- }
Add Comment
Please, Sign In to add comment