WordPress.org

Ready to get started?Download WordPress

Forums

do_shortcode with ajax method (1 post)

  1. dev_mapluz
    Member
    Posted 5 months ago #

    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

Reply

You must log in to post.

About this Topic