Title: Get data Ajax &#8211; tooltips problem
Last modified: March 9, 2020

---

# Get data Ajax – tooltips problem

 *  [pczk](https://wordpress.org/support/users/podlasiaczek/)
 * (@podlasiaczek)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/get-data-ajax-tooltips-problem/)
 * Hello,
 * I have a problem with tooltips after importing ajax. Tooltips not visible.
 * custom.js
 *     ```
       (function($){
           'use strict';
           $(function (e) {
               $('.get_project').on( 'click', function(e) {
                   e.preventDefault();
                   var postid = $(this).attr('data-postid');
                   console.log(postid);
   
                   $.ajax({
                       type: "POST",
                       url: my_ajax_object.ajax_url,
                       data: {
                           action: 'my_load_ajax_content',
                           postid: postid,
                       }
                   }).done(function (data) {
   
       				$('.TARGETDIV').html(data).trigger('post-load');
   
   
   
                   });
               });
           });
       })(jQuery);
       ```
   
 * **functions.php**
 *     ```
       function my_load_ajax_content () {
           $pid = intval($_POST['postid']);
           $the_query  = new WP_Query(array('p' => $pid));
   
           if ($the_query->have_posts() && $pid > 0) {
               while ( $the_query->have_posts() ) {
                   $the_query->the_post();
                   $data = '
                   <div class="post-container">
                       <div id="project-content">
                           <h2 class="custom-h2">' . get_the_title() . '</h2>
                           <!-- <div class="entry-content">'. get_the_content() . '</div> -->
       					<div class="entry-content">' . do_shortcode(get_post_field('post_content', $pid)). '</div>
                       </div>
                   </div>  
                   ';
               }
           }
           else {
               $data = '<div id="postdata">'.__('Not found', THEME_NAME).'</div>';
           }
           wp_reset_postdata();
   
           echo '<div id="postdata">'. $data .'</div>';
           die();
       }
   
       add_action ( 'wp_ajax_nopriv_my_load_ajax_content', 'my_load_ajax_content' );
       add_action ( 'wp_ajax_my_load_ajax_content', 'my_load_ajax_content' );
   
       function my_enqueue() {
           wp_register_script( 'ajax-script', get_template_directory_uri() . '/js/custom.js', array('jquery') );
           wp_localize_script( 'ajax-script', 'my_ajax_object',
               array( 'ajax_url' => admin_url( 'admin-ajax.php' ) )
           );
   
           wp_enqueue_script( 'ajax-script' );
   
   
       }
   
       add_action( 'wp_enqueue_scripts', 'my_enqueue' );
       ```
   
 * Please help, Regards

The topic ‘Get data Ajax – tooltips problem’ is closed to new replies.

 * ![](https://ps.w.org/devvn-image-hotspot/assets/icon-256x256.jpg?rev=1520057)
 * [Image Hotspot by DevVN](https://wordpress.org/plugins/devvn-image-hotspot/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/devvn-image-hotspot/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/devvn-image-hotspot/)
 * [Active Topics](https://wordpress.org/support/plugin/devvn-image-hotspot/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/devvn-image-hotspot/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/devvn-image-hotspot/reviews/)

## Tags

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

 * 0 replies
 * 1 participant
 * Last reply from: [pczk](https://wordpress.org/support/users/podlasiaczek/)
 * Last activity: [6 years, 3 months ago](https://wordpress.org/support/topic/get-data-ajax-tooltips-problem/)
 * Status: not resolved