Prototype Ajax.Updater error - "html has no properties"

Discussion in 'Javascript' started by hardrock, Jun 28, 2006.

  1. hardrock

    hardrock Guest

    Hello!


    I'm working with the prototype library version 1.4.0 and having a
    strange error lately. When I want to make an Ajax.Updater call, it
    basically works. But as soon as I put the call into a function, so that
    I can call it from a popup, I get the error:

    "html has no properties" (in Firefox)


    working code:

    <a href="#" onclick="new Ajax.Updater('images', '...path...',
    {asynchronous:true, evalScripts:false}); return false;">Update 2</a>


    not working code:

    function update ()
    {
    new Ajax.Updater('images', '...path...', {asynchronous:true,
    evalScripts:false});
    }

    <a href="#" onclick="update(); return false;">Update</a>


    I already traced back the code in the prototype.js file:

    950 update: function(element, html) {
    !951 $(element).innerHTML = html.stripScripts();
    952 setTimeout(function() {html.evalScripts()}, 10);
    953 },

    804 updateContent: function() {
    805 var receiver = this.responseIsSuccess() ?
    806 this.containers.success : this.containers.failure;
    807 var response = this.transport.responseText;
    808
    809 if (!this.options.evalScripts)
    810 response = response.stripScripts();
    811
    812 if (receiver) {
    813 if (this.options.insertion) {
    814 new this.options.insertion(receiver, response);
    815 } else {
    !816 Element.update(receiver, response);
    817 }
    818 }

    Does anyone have a clue why that is / could be?

    Regards

    hardrock
     
    hardrock, Jun 28, 2006
    #1
    1. Advertising

  2. hardrock

    Randy Webb Guest

    hardrock said the following on 6/28/2006 6:46 AM:
    > Hello!
    >
    >
    > I'm working with the prototype library version 1.4.0


    I'm sorry.

    > and having a strange error lately.


    That seems to be common with prototype library.

    > When I want to make an Ajax.Updater call, it basically works.


    OK.

    > But as soon as I put the call into a function, so that
    > I can call it from a popup, I get the error:
    >
    > "html has no properties" (in Firefox)


    Did you try contacting the author of prototype.js?

    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
    Temporarily at: http://members.aol.com/_ht_a/hikksnotathome/cljfaq/
    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
     
    Randy Webb, Jun 28, 2006
    #2
    1. Advertising

  3. hardrock

    hardrock Guest

    > Did you try contacting the author of prototype.js?

    No, since I was still expecting this to be a pretty common error with a
    solution that's to find.

    I didn't think that this would be a normal problem with Prototype,
    since even in documentations of Prototype this is listed as code
    example. If you go to
    http://www.sergiopereira.com/articles/prototype.js.html#UsingAjaxUpdater
    you can see that the example given for the Ajax.Updater class is also
    written inside a function body, and I don't think that this guy wrote
    some non-functional code there . . .

    I will try contacting the author of prototype.js though.
     
    hardrock, Jun 28, 2006
    #3
    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:
    149
  2. Replies:
    0
    Views:
    110
  3. Jeff

    prototype.js Ajax.updater

    Jeff, Nov 30, 2006, in forum: Javascript
    Replies:
    0
    Views:
    90
  4. lukemack

    prototype.js and Ajax.Updater

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

    prototype.js and Ajax.Updater

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

Share This Page