Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  • #2
    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
    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]

  • #3
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  • #4
    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
    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]

  • #5
    New to the CF scene
    Join Date
    Feb 2007
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #6
    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
    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]


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •