PDA

View Full Version : Ajax.Updater - Works FF, not IE or Opera!


poggs
03-12-2007, 02:52 AM
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

A1ien51
03-12-2007, 04:15 AM
Well it does not work in FF for me.

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

Eric

poggs
03-12-2007, 05:33 AM
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:

A1ien51
03-12-2007, 05:41 AM
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

poggs
03-12-2007, 06:03 AM
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:

A1ien51
03-12-2007, 06:09 AM
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