messiejessica / imgmap

Automatically exported from code.google.com/p/imgmap
GNU General Public License v2.0
0 stars 0 forks source link

Suggestion: image url with timestamp #13

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Open an image with the following url pattern: "binary?id=4932
2.
3.

What is the expected output? What do you see instead?
I expected that the image would be rendered, instead I saw a broken image

What version of the product are you using? On what browser/operating system?

imgmap2.0 beta6r80
TinyMCE 3.0.4.1
Firefox 2.0.0.12
Mac OS X 10.5.2

Please provide any additional information below.

I see that you try to go around the browser caching mechanism on line 603
in the imgmap.js file by appending ?some_random_value

In some cases the system loads the image from an database, the url therefor
contains a ? sign. Eg. binary?id=4355. So when the image map is adding
another ? the image gets broken.

Here is a suggestion to solve this:

Check if the img contains a ?, if it does append an & instead.

example code: 

var q;
if (img.indexOf('?') > -1)
  q = '&';
else
  q = '?';

this.pic.src = img + q + (new Date().getTime());

Original issue reported on code.google.com by thomasan...@gmail.com on 18 Mar 2008 at 11:54

GoogleCodeExporter commented 8 years ago
Yep, you are right, i will fix that.

Original comment by adam.mas...@gmail.com on 24 Mar 2008 at 9:51

GoogleCodeExporter commented 8 years ago
fixed in rev52

Original comment by adam.mas...@gmail.com on 9 Apr 2008 at 10:46