Title: do_shortcode with ajax method
Last modified: August 21, 2016

---

# do_shortcode with ajax method

 *  [dev_mapluz](https://wordpress.org/support/users/dev_mapluz/)
 * (@dev_mapluz)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/do_shortcode-with-ajax-method/)
 * hi
    i’m loaded businessdirectiry plugins with the codex function do_shortcode
   in my wordpress page like this :
 *     ```
       <?php
       echo do_shortcode('[businessdirectory]');
       ?>
       ```
   
 * it run very well!
    now i want to call it from a php page, **map.php** :
 *     ```
       <?php
       echo do_shortcode('[businessdirectory]');
       ?>
       ```
   
 * the **map.php** file is loaded when clicking on an input button on my wordpress
   page like this :
 *     ```
       <script type="javascript">
       function reload()
       {
       var xhr_object = new XMLHttpRequest();
       xhr_object = new ActiveXObject("Msxml2.XMLHTTP");
       xhr_object.open("GET", "http://localhost/test/map.php", false);
       xhr_object.setRequestHeader("Content-Type","application/x-www-form-urlencoded; charset=utf-8");
       xhr_object.send(null);
       document.getElementById('result').innerHTML = xhr_object.responseText;
       }
       </script>
       <form method="post" action="javascript:reload()" >
       <input type="submit" name="btok" id="btok" value="OK" >
       </form>
       <div id='result'></div>
       ```
   
 * but nothing appending ! the div tag is empty !
    have you another solution
 * thanks

The topic ‘do_shortcode with ajax method’ is closed to new replies.

## Tags

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

 * 0 replies
 * 1 participant
 * Last reply from: [dev_mapluz](https://wordpress.org/support/users/dev_mapluz/)
 * Last activity: [12 years, 6 months ago](https://wordpress.org/support/topic/do_shortcode-with-ajax-method/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
