Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-12-2007, 02:52 AM   PM User | #1
poggs
New to the CF scene

 
Join Date: Feb 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
poggs is an unknown quantity at this point
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:
Code:
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!!!

Thanks,
Poggs
poggs is offline   Reply With Quote
Old 03-12-2007, 04:15 AM   PM User | #2
A1ien51
Senior Coder

 
A1ien51's Avatar
 
Join Date: Jun 2002
Location: Between DC and Baltimore In a Cave
Posts: 2,717
Thanks: 1
Thanked 94 Times in 88 Posts
A1ien51 will become famous soon enough
Well it does not work in FF for me.

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

Eric
__________________
Tech Author [Ajax In Action, JavaScript: Visual Blueprint]
A1ien51 is offline   Reply With Quote
Old 03-12-2007, 05:33 AM   PM User | #3
poggs
New to the CF scene

 
Join Date: Feb 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
poggs is an unknown quantity at this point
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.

poggs is offline   Reply With Quote
Old 03-12-2007, 05:41 AM   PM User | #4
A1ien51
Senior Coder

 
A1ien51's Avatar
 
Join Date: Jun 2002
Location: Between DC and Baltimore In a Cave
Posts: 2,717
Thanks: 1
Thanked 94 Times in 88 Posts
A1ien51 will become famous soon enough
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
__________________
Tech Author [Ajax In Action, JavaScript: Visual Blueprint]
A1ien51 is offline   Reply With Quote
Old 03-12-2007, 06:03 AM   PM User | #5
poggs
New to the CF scene

 
Join Date: Feb 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
poggs is an unknown quantity at this point
Quote:
Remove that trailing comma

It appears to be working now!!!

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

Thanks so much
poggs is offline   Reply With Quote
Old 03-12-2007, 06:09 AM   PM User | #6
A1ien51
Senior Coder

 
A1ien51's Avatar
 
Join Date: Jun 2002
Location: Between DC and Baltimore In a Cave
Posts: 2,717
Thanks: 1
Thanked 94 Times in 88 Posts
A1ien51 will become famous soon enough
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
__________________
Tech Author [Ajax In Action, JavaScript: Visual Blueprint]
A1ien51 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:59 PM.


Advertisement
Log in to turn off these ads.