prototype.js Ajax.updater

Discussion in 'Javascript' started by Jeff, Nov 30, 2006.

  1. Jeff

    Jeff Guest

    I'd like to use Ajax.updater to update a container whose id is
    generated dynamically. Here was my first thought:

    function getEditor(id) {
    var url = '/include/helper.php';
    var prm = 'what=editor&id='+id;
    var ajx = new Ajax.Updater(id, url, { method: 'get', parameters: prm
    });
    }

    That fails. If I hardcode the container it works fine:

    function getEditor(id) {
    var url = '/include/helper.php';
    var prm = 'what=editor&id='+id;
    var ajx = new Ajax.Updater('1000', url, { method: 'get', parameters:
    prm });
    }

    This works.

    Any thoughts?
    Jeff, Nov 30, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    1
    Views:
    147
  2. hardrock
    Replies:
    2
    Views:
    97
    hardrock
    Jun 28, 2006
  3. Replies:
    0
    Views:
    101
  4. lukemack

    prototype.js and Ajax.Updater

    lukemack, Mar 5, 2007, in forum: Javascript
    Replies:
    2
    Views:
    170
    lukemack
    Mar 5, 2007
  5. lukemack

    prototype.js and Ajax.Updater

    lukemack, Mar 5, 2007, in forum: Javascript
    Replies:
    1
    Views:
    95
    lukemack
    Mar 5, 2007
Loading...

Share This Page