MySQL Forums
Forum List  »  PHP

Re: <?php echo $row_nav['ID'=2]; ?>
Posted by: Rick James
Date: February 25, 2009 09:29PM

I'm a little lost. I envision multiple was it could work...

1. User clicks on image, then you load another page with other stuff. (2 page views)

2. User clicks on image, onClick recognizes the click, calls a JavaScript function, which changes other DIVs from "hidden" to "visible". (1 page view)

3. User clicks, JavaScript calls the server (same machine, I guess) via AJAX to get some more information, then JS builds other DIV(s). (1 page view)

If you are pre-building the IMG tags (#2), that goes something like
// Javascript function
<script>
function foo()
{
    document.bar.visibility = 'visible';
}
</script>
// visible image
echo "<div>";
echo "<img src=$url onClick=foo()>";
echo "</div>";
// Initially-hidden image:
... SELECT ... and put result into $url
echo "<div id=bar style=\"visibility=hidden">";
echo "<img src=$url>";
echo "</div>";

Caveat! There are probably typos, spelling errors, etc in the above code.

But I guess you were talking about #1. Can you elaborate.

Options: ReplyQuote


Subject
Written By
Posted
Re: <?php echo $row_nav['ID'=2]; ?>
February 25, 2009 09:29PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.