By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,853 Members | 1,541 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,853 IT Pros & Developers. It's quick & easy.

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

P: n/a
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

Jun 28 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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/
Jun 28 '06 #2

P: n/a
> 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/article...ingAjaxUpdater
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.

Jun 28 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.