jackbenimble4
08-18-2007, 06:39 PM
Hello, this is my first time on this particular site. I'm here because of a problem I'm having with one of my latest applications.
This application uses Javascript, PHP, and the GD Library of PHP to create images based on user input. For example, the user can choose to add text, and a div with various forms controlling every aspect of the text (color, size, angle, x and y axes, font, the string, etc.) appears as a layer. The user can add as many elements/layers as they want, and click a button to save the data through Ajax.
Everything works flawlessly in Mozilla, and as well as can be expected in Internet Explorer. However, with Safari 2.0.4, the image never updates. The ajax request goes through, and the data gets into the database, but the image isn't updated.
Here's the line I use to refresh the image:
getId("gamercardBg").src = 'preview.php?t=' + templatehash + '&d=' + new Date().getTime();
It simply gets the image element, and changes the source to the url of the image, with an appended 'dud' variable to trick the browser into downloading it again, instead of calling it from it's cache. Is there any reason why this shouldn't work in Safari? Does Safari have some weird caching issues that I can somehow change through HTTP Headers, or something?
If Safari ignores the appended timestamp, maybe I could use mod_rewrite to fake a totally different image filename.
Any feedback would be appreciated, :)
This application uses Javascript, PHP, and the GD Library of PHP to create images based on user input. For example, the user can choose to add text, and a div with various forms controlling every aspect of the text (color, size, angle, x and y axes, font, the string, etc.) appears as a layer. The user can add as many elements/layers as they want, and click a button to save the data through Ajax.
Everything works flawlessly in Mozilla, and as well as can be expected in Internet Explorer. However, with Safari 2.0.4, the image never updates. The ajax request goes through, and the data gets into the database, but the image isn't updated.
Here's the line I use to refresh the image:
getId("gamercardBg").src = 'preview.php?t=' + templatehash + '&d=' + new Date().getTime();
It simply gets the image element, and changes the source to the url of the image, with an appended 'dud' variable to trick the browser into downloading it again, instead of calling it from it's cache. Is there any reason why this shouldn't work in Safari? Does Safari have some weird caching issues that I can somehow change through HTTP Headers, or something?
If Safari ignores the appended timestamp, maybe I could use mod_rewrite to fake a totally different image filename.
Any feedback would be appreciated, :)