Thanks for your hints, I now found the solution. 

The browser cached the file, so I attached a random number at the end of the
src tag:

<img src="/cake/mycontroller/graph/".<?php echo rand(); ?>" /> 

I also put a <div id="myimage"> tag around the img tag and update the div in
the ajax call, not the image itself. In the Ajax call it is important to
call a new page, where you have just the <img> tag in:

$options = array('url' => 'page_with_only_img_tag, 'update' => 'myimage');
echo $ajax->observeField('selecttag',$options);

If you try to update directly the implemented <img>, it does not work.

Make shure to put the layout of this page to ajax by adding the line
$this->layout='ajax'; in the controller.

Greets Tom

> -----Original Message-----
> From: [email protected] [mailto:[EMAIL PROTECTED] On
> Behalf Of [EMAIL PROTECTED]
> Sent: Saturday, January 12, 2008 10:31 PM
> To: Cake PHP
> Subject: Re: Ajax update of JpGraph in CakePHP
> 
> 
> I think this is a browser issue, I've found that, if you change an
> image that has already been downloaded, the browser will use the
> cached image instead of re-downloading the updated image from the
> server. What I've done to get around this is to create a temporary
> image with a random name, then the browser doesn't have a cached image
> and is forced to download it. I'm not all that familiar with JpGraphs
> but I bet if you save the resulting graph as an image with a random
> name, it will fix your problems.
> 
> Dave


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to