Created
November 2, 2017 15:32
-
-
Save pbrocks/11a2c824e79bb78f5c5471e6d60064ae to your computer and use it in GitHub Desktop.
JS as part of AJAX call
This file contains hidden or 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
jQuery(document).ready(function($) { | |
$('#location_select_submit').click(function() { | |
$.ajax({ | |
type: "POST", | |
url: location_select_script.location_select_ajaxurl, | |
data: { | |
// Variables defined from form | |
action : 'location_select_action', | |
serialize : $('#location-select-form').serialize(), | |
custjson : $('#custjson').val(), | |
custnumber : $('#custnumber').val(), | |
selected : $('#selected-location').val(), | |
// Admin stuff | |
script_name : 'if-location-select.js', | |
ajaxurl: location_select_script.location_select_ajaxurl, | |
nonce : location_select_script.location_select_nonce, | |
}, | |
success:function( data ) { | |
// $('#location-select-response').html( data ); | |
$('#location_select_response').html( data ); | |
$('#location-select-contacts').html( data ); | |
// console.log(data); | |
}, | |
error: function(){ | |
console.log(errorThrown); | |
} | |
}); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is the latest iteration of the JS.