-
loading a php file through javascript
Ok I'm using a dynamic php page that loads a graphic from mysql data..
<img src="imageMeter.php">
I call that in a javascript file that puts it to a div tag
document.getElementById('element1').innerHTML = "<img src='imageMeter.php'>";
So clicking a particular javscript link displays the given graph to the element1 div.
My question is, is it possible, using a similar technique, that displays the output of a standard .php file?
Example
document.getElementById('element1').innerHTML = 'testpage.php'
where testpage.php is
<?php
echo "test string";
?>
Then clicking the link would put 'test string' into the element1 div tag...
-
-
-
-
Yea I thought of that.
I was trying to find away to so it similar to the <img> tag. I already have multiple ajax requests on the page so was trying to stay away from another one...
Was just looking for ideas..
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks