Can I please have some help to load a PHP file from a DIV call.
Here is my code:
<html>
<head>
</head>
<body>
<script class="code" type="text/javascript">
$("#LoadPHP").load("fb_marketing.php");
</script>
<div id="LoadPHP">Load PHP Here</div>
</body>
</html>
If you cannot tell what I am trying to do, I will explain it. Basically, I am wanting to load the ‘fb_marketing.php’ file when a reference is made to a DIV on a webpage.
The above code is not working. Can I please have some help to get it working?
Thanks in advance
I believe you are missing your jQuery library. In order to call the
loadfunction which is a part of the jQuery library, you need to include the library in yourhead.Furthermore, I would wait until the entire DOM is loaded first by wrapping the code in a
$.ready(function() { //code here });method.