I am building a simple website using php in a mvc fomat and I'm trying to use ajax to call a simple clock but having trouble. Right now im just tyring to get a "hello world" example in my code to get started and go from there. An example format of my php class is : (the hello.php just echos hello world, and a Run() is being called at an index.php). For the life of me I can not get the script to work , any help would be appreciated. Thank you.
<?php
class MyFile{
public static function Run(){
MyFile::show();
}
public static function show(){
echo 'html stuff';
?>
//run this sample ajax script i found //
<body>
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
$.get("hello.php", function(data){
alert(data);
});
});
</script>
</body>
<?php
}
}
?>