Title: Ajax Variable not being returned from JavaScript
Last modified: August 21, 2016

---

# Ajax Variable not being returned from JavaScript

 *  Resolved [mikeill](https://wordpress.org/support/users/mikeill/)
 * (@mikeill)
 * [12 years ago](https://wordpress.org/support/topic/ajax-variable-not-being-returned-from-javascript/)
 * I’m receiving the variable to JavaScript, but not getting it back in PHP, and
   I think Its not being coded correctly in the JavaScript:
 *     ```
       function glitch_player_display(mix_name) {
       		alert(mix_name);
       		throb.start();
       		jQuery.ajax({
       			type: 'POST',
       			url: ajaxglitch_playerajax.ajaxurl,
       			data: {
       				action: 'ajaxglitch_player_ajaxhandler',
       				mix_name: mix_name
       			},
       			success: function(data, textStatus, XMLHttpRequest) {
       			throb.stop();
       				var showglitchplayer = '#showglitchplayer';
       				jQuery(showglitchplayer).html('');
       				jQuery(showglitchplayer).append(data);
       			},
       			error: function(MLHttpRequest, textStatus, errorThrown) {
       				alert(errorThrown);
       			}
       		});
       	}
       ```
   
 * This is the php:
 *     ```
       function ajaxglitch_player_ajaxhandler($arguments){
       	var_dump($arguments);
       }
       ```
   
 * returns empty.

Viewing 1 replies (of 1 total)

 *  Thread Starter [mikeill](https://wordpress.org/support/users/mikeill/)
 * (@mikeill)
 * [12 years ago](https://wordpress.org/support/topic/ajax-variable-not-being-returned-from-javascript/#post-4972265)
 * Answered on [Stack Exchange](http://wordpress.stackexchange.com/a/147340/48604)

Viewing 1 replies (of 1 total)

The topic ‘Ajax Variable not being returned from JavaScript’ is closed to new replies.

## Tags

 * [ajax](https://wordpress.org/support/topic-tag/ajax/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 1 participant
 * Last reply from: [mikeill](https://wordpress.org/support/users/mikeill/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/ajax-variable-not-being-returned-from-javascript/#post-4972265)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
