Ok so after some fiddling around I have hit the "talent wall", Basically I want to have an call from a js/Jquery menu system to the class that calls the other class to get the data from the db and then target a <div> on the page and refresh that div.
Each page is called and an instance created with the following code;
include_once "content_home.class.php";
$Home = new home();
- include_once "content_home.class.php";
- $Home = new home();
so the menu item onclick event calls this;
function showHomePage()
{
document.getElementById('content').innerHTML="homePageContent.php"; //this is were I want the targeting to be done
}
- function showHomePage()
- {
- document.getElementById('content').innerHTML="homePageContent.php"; //this is were I want the targeting to be done
- }
Is there a way that I can do this without having to pass the data into an array, so I can just use the onclick event to use run php includes and update the target div?
so basically this ;
function showHomePage()
{
document.getElementById('content').innerHTML= "<?php include_once "content_home.class.php"; $Home = new home();?>"
}
- function showHomePage()
- {
- document.getElementById('content').innerHTML= "<?php include_once "content_home.class.php"; $Home = new home();?>"
- }
or this might help show what I want to do;
function showHomePage()
{
document.getElementById('content').innerHTML= '<?php require_once "content_home.class.php";?>'
+'<?php $Home = new home()?>';
}
- function showHomePage()
- {
- document.getElementById('content').innerHTML= '<?php require_once "content_home.class.php";?>'
- +'<?php $Home = new home()?>';
- }
If that makes sense ??