Ajax Content

0 views
Skip to first unread message

jbogdani

unread,
Aug 6, 2010, 8:31:39 AM8/6/10
to Qutensil
Hi,
I've made few changes to q.window.js to have the possibility to load
content dynamically in the window using Prototype Ajax.Updater.
The content is loaded from a URL that is added as q.window options
(just like the text option).
The changes are:
1)
about line 199:
if (this.options.source && (source = $(this.options.source))) {
this.update(source.innerHTML);
source.remove();
} else if(this.options.url){ //<-- added
this.ajaxUpdate(this.options.url); //<-- added
} else {
this.update(this.options.text);
}

2) new method:
//update the window content with data from Ajax.Updater (url
needed!)
ajaxUpdate: function(url){
var content=this.holder.content
.update(new Element("div")
.setStyle({ height: "10px" }));
new Ajax.Updater(content, url, {evalScripts:'true',
insertion:Insertion.Bottom});
return this;
},

I think it could be implemented in q.window core in future versions.
It's useful to have the possibility to load content async.
Could be implemented to show a waiting gif in onLoading.

wonderingwout

unread,
Aug 7, 2010, 3:11:56 AM8/7/10
to Qutensil
You're not the first one asking for this feature.
I'll implement it as well.

Wout
Reply all
Reply to author
Forward
0 new messages