I always use new Date().getTime() as there's no possible way to get the same
number twice (unless you request it again within a millisecond). Your random
way has a .1% chance of duplicating...

On Fri, Jan 30, 2009 at 3:45 PM, Matt Thomson (via Nabble) <
[email protected]<ml-user%[email protected]>
> wrote:

>
> It works!! Thanks so much , I have spent about 5 hours on this bug
> trying every different way to load an image.
>
> I used:
> this.randomNumber = Math.floor(Math.random()*1001);
> this.imageToFadeIn = new Asset.images([this.imgPath + '?random=' +
> this.randomNumber])....
>
> I guess it fools IE into thinking the request is original, and it
> doesn't load it's cache of the image dimensions.
>
> On Jan 31, 12:22 pm, nutron 
> <anut...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2247852&i=0>>
> wrote:
>
> > yes, the query string should be ignored by your server and by the
> browser.
> >
> > On Fri, Jan 30, 2009 at 3:19 PM, Matt Thomson (via Nabble) <
> > ml-user+93022-1622349...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2247852&i=1>
> <ml-user%2b93022-1622349...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2247852&i=2>>
>
> >
> >
> >
> > > wrote:
> >
> > > In my example this.imgPath is a string that is something like 'http://
> > >www.site.com/images/myImage.gif'
> >
> > > Is there a way to append something to this and still get myImage.gif?,
> >
> > > Thanks,
> >
> > > Matt
> >
> > > On Jan 31, 11:55 am, nutron <anut...@...<
> http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2247731&i=0>>
> > > wrote:
> >
> > > > maybe append a random query string to the path?
> > > > new Asset.images(this.imgPath+'?noCache='+ new Date().getTime());
> >
> > > > On Fri, Jan 30, 2009 at 2:45 PM, Matt Thomson (via Nabble) <
> > > > ml-user+93022-1622349...@...<
> http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2247731&i=1>
> > > <ml-user%2b93022-1622349...@...<
> http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2247731&i=2>>
> >
> > > > > wrote:
> >
> > > > > Hi I am loading an image like this:
> >
> > > > > this.imageTest = new Asset.images(this.imgPath,
> > > > >         {
> > > > >                 onComplete: function()
> > > > >                 {
> > > > >                    this.imageTest[0].injectTop(this.container);
> > > > >                 }
> > > > >         });
> >
> > > > > If the image is 800 X 600, IE will work properly. If I change the
> > > > > image on the server to to 400 X 300, IE will download the correct
> > > > > image, but it will stretch it out to 800 X 600.
> >
> > > > > I have tried this method:
> >
> > > > >
> http://social.msdn.microsoft.com/forums/en-US/iewebdevelopment/thread...
> >
> > > > > but obj = document.createElement("<img src='test1.gif'>"); kills
> the
> > > > > script for me.
> >
> > > > > I have also tried(inside the onComplete: function() ):
> >
> > > > > this.ImgToLoad = new Element('img',
> > > > > {
> > > > >      'src': this.imgPath
> > > > > });
> > > > > this.ImgToLoad.injectTop(this.container);
> >
> > > > > The strange thing is if I browse to the image on the server IE
> > > > > displays it correctly, and if the image is loaded from the html it
> > > > > displays correctly. When it is loaded with javascript IE gets the
> > > > > imgsize from a couple of days ago, regardless of the size of the
> image
> > > > > in the cache.
> >
> > > > > Does anyone have any ideas how to get around this bug,
> >
> > > > > Thanks,
> >
> > > > > Matt.
> >
> > > > > ------------------------------
> > > > >  View message @
> > > > >
> http://n2.nabble.com/Internet-explorer-caching-image-size-tp2247600p2...
> >
> > > > > To start a new topic under MooTools Users, email
> > > > > ml-node+660466-1583815...@...<
> http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2247731&i=3>
> > > <ml-node%2b660466-1583815...@...<
> http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2247731&i=4>>
> >
> > > > > To unsubscribe from MooTools Users, click here< (link removed) >.
> >
> > > > -----
> > > > The MooTools Tutorial:  http://www.mootorial.comwww.mootorial.com
> > > > Clientcide:  http://www.clientcide.comwww.clientcide.com
> > > > --
> > > > View this message in context:
> > >http://n2.nabble.com/Internet-explorer-caching-image-size-tp2247600p2...
>
> > > > Sent from the MooTools Users mailing list archive at Nabble.com.
> >
> > > ------------------------------
> > >  View message @
> > >http://n2.nabble.com/Internet-explorer-caching-image-size-tp2247600p2...
>
> > > To start a new topic under MooTools Users, email
> > > ml-node+660466-1583815...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2247852&i=3>
> <ml-node%2b660466-1583815...@...<http://n2.nabble.com/user/SendEmail.jtp?type=node&node=2247852&i=4>>
>
> > > To unsubscribe from MooTools Users, click here< (link removed) >.
> >
> > -----
> > The MooTools Tutorial:  http://www.mootorial.comwww.mootorial.com
> > Clientcide:  http://www.clientcide.comwww.clientcide.com
> > --
> > View this message in context:
> http://n2.nabble.com/Internet-explorer-caching-image-size-tp2247600p2...
> > Sent from the MooTools Users mailing list archive at Nabble.com.
>
>
> ------------------------------
>  View message @
> http://n2.nabble.com/Internet-explorer-caching-image-size-tp2247600p2247852.html
> To start a new topic under MooTools Users, email
> [email protected]<ml-node%[email protected]>
> To unsubscribe from MooTools Users, click here< (link removed) >.
>
>
>


-----
The MooTools Tutorial:  http://www.mootorial.com www.mootorial.com 
Clientcide:  http://www.clientcide.com www.clientcide.com 
-- 
View this message in context: 
http://n2.nabble.com/Internet-explorer-caching-image-size-tp2247600p2247880.html
Sent from the MooTools Users mailing list archive at Nabble.com.

Reply via email to