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

H

hardrock

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
 
R

Randy Webb

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?
 
H

hardrock

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top