Title: undefined $ error in jQuery function
Last modified: August 19, 2016

---

# undefined $ error in jQuery function

 *  [farazch](https://wordpress.org/support/users/farazch/)
 * (@farazch)
 * [16 years ago](https://wordpress.org/support/topic/undefined-error-in-jquery-function/)
 * I want to write my jquery function
 *     ```
       function insert_post()
       {
       		$.post('ajax_post_insert.php' , {}
       		,function(str)
       		{
       			alert(str);
       			$("#load_gallery").html(str);}
       		);
       }
       ```
   
 * But its giving JS error ‘$ is undefined’.The jquery.js file is also included,
   i confirmed it.How can i achieve this functionality in wordpress ?
    Thanks.

Viewing 1 replies (of 1 total)

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [16 years ago](https://wordpress.org/support/topic/undefined-error-in-jquery-function/#post-1537422)
 * [http://codex.wordpress.org/Function_Reference/wp_enqueue_script#jQuery_noConflict_wrappers](http://codex.wordpress.org/Function_Reference/wp_enqueue_script#jQuery_noConflict_wrappers)

Viewing 1 replies (of 1 total)

The topic ‘undefined $ error in jQuery function’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [esmi](https://wordpress.org/support/users/esmi/)
 * Last activity: [16 years ago](https://wordpress.org/support/topic/undefined-error-in-jquery-function/#post-1537422)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
