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.

    <script>
        $(function() {
        $("body").click(function(e) {
                if (e.target.id == "contentblock" || $(e.target).parents("#contentblock").size()) {
                    //alert("Inside div");
                    if ($(e.target).is("a")) {
                        $('#afterdownload').fadeIn('slow');
                        $('#ajax').load('test.php');
                    }
                });
            <?php ?>
        }
        }
        });
        })   
        </script>

    <div id="ajax"></div>

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


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: