View Full Version : Ajax Page Fetcher Question

01-13-2008, 08:04 AM
I've got an image that changes whenever you select a different item from a select box. When I use the Ajax Page Fetcher it shows the default image and not the image that was selected from the select box.

Is there any way to edit the code to show the image selected? Here's the url for what I'm doing:http://har**villedesign.com/har**villedesign/gil_u_d.html (http://www.har**villedesign.com/har**villedesign/gil_u_d.html) (delete the ** in the url. I only have the first few clickable at this point.

Any help is appreciated!

01-13-2008, 03:11 PM
Hmm I'm not too sure where I should be looking on the link you provided for an example of the issue. Anyhow, if the select menu is on the external page being fetched by Ajax, it may not work once transferred over to the main page, as it's powered using JavaScript I assume, and Ajax isn't always able to fully migrate the script from the external page to the main. That's why Ajax Page Fetcher also supports dynamic loading of .js files (see script page), which may be the solution for you.

01-13-2008, 03:48 PM
dont use AJAX for that have some thing like this

<script type="text/javascript">
function images(img)
document.getelementbyid('image').src = img;

Your Image code

<img src='' id="image" onload="images('*default image*');" />

Then have onclick or onhover affect on the trigers that run image('*image Address*');

I hope this works for you if you are wanting it to get the images addresses from a DB have some thing like this

$query = mysql_query('SELECT (img, ID) FROM `Images`)
echo '<script type="text/javascript">';
while($row = mysql_fetch_array($query))
echo 'var image['.$row['ID'].'] = "'.$row['img'].'";
echo '</script>'

I hope this helps u and the last code bit is PHP