I have some script that works on my dev server but not on my staging server:
add_action('wp_head','get_gz_info',30);
function get_gz_info(){
?>
<script type="text/javascript" >
jQuery(document).ready(function($) {
var modal = {action:'modal_action'};
var ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>';
$.post(ajaxurl,modal,function(data){
$('body').append(data);
});
});
</script>
<?php
}
the php is roughly:
add_action('wp_ajax_modal_action', 'set_modal');
add_action('wp_ajax_nopriv_modal_action', 'set_modal');
function set_modal() {
...
}
Everything works fine on my dev side but the staging side the javascript is placed in the header (just like the dev) but it won't run the "ajax part". Could it be that the staging side requires a username/password to access it?
I've attempted it with and without the https and get the same results
----- EDIT -----
Note: I'm using ajax in the admin on the staging server it that works fine. It's only on the user side that I'm having an issue.