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