Title: use jquery get function
Last modified: August 21, 2016

---

# use jquery get function

 *  Resolved [T.oby](https://wordpress.org/support/users/toby-1/)
 * (@toby-1)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/use-jquery-get-function/)
 * Hi, I would like to use the javascript jquery get function in the following simple
   example:
 *     ```
       <script type="text/javascript" src="/wp-includes/js/jquery/jquery.js"></script>
       <script type="text/javascript">
       $.get('http://www.w3schools.com/images/w3schoolscom_gray.gif').done(
         function() {
               alert("image exists");
           }).fail(function() {
               alert("image does not exist");
           })
       </script>
       ```
   
 * I assume here that the jquery library is in ‘/wp-includes/js/jquery/jquery.js’
   of the wordpress root folder which seems to be the case for my wordpress installation.
   However I think I am missing something because when opening the page nothing 
   comes up.
 * Thanks for any help!
 * Toby

Viewing 1 replies (of 1 total)

 *  Thread Starter [T.oby](https://wordpress.org/support/users/toby-1/)
 * (@toby-1)
 * [12 years, 1 month ago](https://wordpress.org/support/topic/use-jquery-get-function/#post-4807591)
 * It seems WordPress loads by default the jquery library. But WordPress works in
   noConflict() mode where the $ operator is not available. Therefore I wrapped 
   my code as suggested in [http://codex.wordpress.org/Function_Reference/wp_enqueue_script#jQuery_noConflict_wrappers](http://codex.wordpress.org/Function_Reference/wp_enqueue_script#jQuery_noConflict_wrappers).
 *     ```
       <script>
       jQuery(document).ready(function($) {
         $.get('http://portal.3yd.de/wp-content/uploads/2014/04/guggenheim2.jpg').done(
           function() {
               alert("image exists");
           }).fail(function() {
               alert("image does not exist");
           });
       });
       </script>
       ```
   
 * However funnily the code only works with images on my website not the w3schools
   website.

Viewing 1 replies (of 1 total)

The topic ‘use jquery get function’ is closed to new replies.

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 1 participant
 * Last reply from: [T.oby](https://wordpress.org/support/users/toby-1/)
 * Last activity: [12 years, 1 month ago](https://wordpress.org/support/topic/use-jquery-get-function/#post-4807591)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
