iframe loading twice

Page: 1

Author Post
mikes
Guest
Hi there,

I am using floatbox to display a popup when adding products to a basket.

The link I am using is as follows....

<a class="good_stock" href="/site/basket/add?part=A3-25&qty=1" rel="floatbox" title="Add to basket (96 in stock)" rev="caption:`Add to Basket`; width: 750px; height: 500px; scrolling: auto; href:`/site/basket/add?plain=1&part=A3-25`;">&pound;1.09 <img src="/app/images/icons/basket_add.png" /></a>

The problem is that I am seeing 2 requests for /site/basket/add in the server log.

I have coded around it for now but I would like to make subsequent requests increment the quantity. As it stands the quantity gets incremented by 2!

If you would like to see the page in question it's at www dot lasaero dot com. Click Sport and General Aviation then click on a "Popular Product" from the right hand side. You can add items by clicking on a price.

I'm not sure but I don't think I had this issue with the previous version...

PS - thanks for all the hard work you put into floatbox, it's very much appreciated!
Administrator
Registered: Aug 2008
Posts: 3382
I can reproduce this double-fetch from my own pages. I'll try to suss out the source of it and will get back to you in the next 24 hours.
mikes
Guest
No problem, thanks for looking into it. :)
Administrator
Registered: Aug 2008
Posts: 3382
It's a dumb error with preloading of images. Two errors actually. The first is that when a standalone item (not part of a set) has completed showing, the image preloader is restarted with a re-fetch of the current, already fetched, item. The second error is that this preload re-fetch is promiscuous and will try a preload of any item type, not just images.

I have a one line edit to core.js for you that will settle this down. It's a temporary hack. The next posted version will have a proper fix included. If you use the compressed floatbox files, you will need to regenerate new compressed files of core.js from your edited one (or wait for the posted update).

In floatbox/modules/core.js, version 3.51, the following line should be line number 1534 (line 1511 in v3.50):
fb.preloadImages(t.nextHref || t.prevHref || '', true);


Change that line to:
fb.preloadImages('', true);
mikes
Guest
Thanks for the fix! :D

Page: 1