load .php file in div with ajax (wordpress)

I have a script that shows a box after i clicked a download link in my single page (this works).

I also want it to load a test.php in a certain div. But for some reason it will not work. test.php is located in my theme folder. Even when I try to ad it to my root it won’t work.

        $(function() {
        $("body").click(function(e) {
                if (e.target.id == "contentblock" || $(e.target).parents("#contentblock").size()) {
                    //alert("Inside div");
                    if ($(e.target).is("a")) {
            <?php ?>
    <div id="ajax"></div>

Read more here: load .php file in div with ajax (wordpress)

Leave a Reply

Your email address will not be published. Required fields are marked *