Forum Moderators: coopster
One easy method/use is for inserting/embedding text or HTML -- the PHP would just return a JavaScript document.write() command.
// You may need to add a content-type header:
header("Content-type: application/x-javascript");
// This must be done before the script outputs any data.$output_string="Hello There<br>";
echo "document.write('" . $output_string . "');";
/*
The script would be called within a <script src="script.php"></script> object and it can return any JavaScript code you like.
*/
You can also return images, and other dynamic content this way --
[edited by: coopster at 1:48 pm (utc) on Sep. 21, 2006]
[edit reason] no urls please TOS [webmasterworld.com] [/edit]