Helpful Information
 
 
Category: Ajax and Design
Ajax.Updater - Works FF, not IE or Opera!

Hi,

Could anyone shed any light as to why my updater function doesn't seem to be working on this webpage:

http://www.artystafineart.co.uk/testing/gallery.php

the function i'm using, when a thumbnail is clicked (in order to bring up details of the image on the left-hand side), is:

function getGallery(i) {

var url = 'gallery-generator.php';
var pars = 'ItemID=' + i;

var myAjax = new Ajax.Updater(
{success:'galleryitems'},
url,
{
method:'get',
parameters: pars,
onFailure: reportError,
});
document.getElementById('temptext').style.display = "none";
}
... where "i" is the itemID of the thumb.

The whole thing works great in Firefox, but not in IE7 or Opera.

Please, please, please help if you can!!! :o

Thanks,
Poggs

Well it does not work in FF for me.

You probably should not have both Prototype and Prototype lite on the same page.

Eric

Hmmm, that's odd, it seems to work fine here on Firefox 1.5 and 2 :(

I've combined the prototype files so that only one is being called in.

:confused:

I was getting an Ajax error in both browsers before

I think the problem is here:

var myAjax = new Ajax.Updater(
{success:'galleryitems'},
url,
{
method:'get',
parameters: pars,
onFailure: reportError,
});

Remove that trailing comma

Eric

Remove that trailing comma

:eek:
It appears to be working now!!!

I can't believe the stress i've endured tonight was down to a comma :o

Thanks so much :thumbsup:

FYI:

The JSON specs say there can not be a trailing comma after the last item. IE abides by it, Firefox lets it through. :)

Usually it is the other way around!

Eric










privacy (GDPR)