This article references an external link -- click here to visit
http://nodstrum.com/index.php?s=jQuery
http://nodstrum.com/index.php?s=jQuery
Dynamic HTML content loading... very easy to implement in a normal static website and its brilliant if you want to load something from
text files, xml's, pictures, even other websites!
Start by downloading the jQuery Content Loading ZIP files. This contains jQuery 1.2, index.html and rpc.php
NOTE: You will need a webserver running php to use this. WAY BEYOND the scope of this article
Once you have the files unzipped in your webservers document root you will have something that looks like the example from the site.
What you now obviously want to do is spice it up with your own CSS and have something really dynamic load when you click the links...
Open up rpc.php in VI or what ever you use to program and edit (Notepad, Dreamweaver etc).
The green code is what I added
<?php
$cOption = $_GET['o'];
$dynamic_source = "";
switch($cOption) {
case 1:
$dynamic_url = "your/target/file.whatever";
$fp = fopen($dynamic_url, "r") or die("The Information couldn't be displayed!");
while(! feof($fp))
{
$dynamic_source = $dynamic_source . fgets($fp, 1024);
} print $dynamic_source;
break;
default:
echo 'Whoops, I havent had time to implement that yet...: <i>'.$cOption.'</i>';
}
?>
You can add as many cases as you like... just remember to add a button to it.
Hope this helps someone someday...
It beats having to put static code in the case statement as in the example... I seriously dont know why they always use static examples for dynamic code...
Someday when I have time I'll play around and get a busy indicator built in... Someday (tm)







2 Comments
My programming sucks.. so if its not on the web... I wont be making it :D
Hey you know AdGuy always gets the last word! ;)