felipeebs Posted February 21, 2007 Share Posted February 21, 2007 Hi, I am using Prototype AJAX fremework and want to put a loading during the request: The JS: function protoAJAX(url,div,pars){ var myAjax = new Ajax.Updater( place, url, {method: 'get', parameters: pars}); } In the page headers I've included the prototype.js and in the body I've created the menu and the centercontent div The link: <a href="#" onclick="protoAJAX('page.html','centercontent','')">Prototype</a> A link to nothing, onclick call function protoAJAX that put page.html in centercontent div calling no special params to it The javascript works correctlly but I don't know how to display the "Loading..." message If anyone can help Thanks Link to comment https://forums.phpfreaks.com/topic/39545-help-to-put-a-loading-with-prototype/ Share on other sites More sharing options...
felipeebs Posted February 22, 2007 Author Share Posted February 22, 2007 please, anyone, I need this (sorry... but I needed to reply my own topic :x) Link to comment https://forums.phpfreaks.com/topic/39545-help-to-put-a-loading-with-prototype/#findComment-191600 Share on other sites More sharing options...
mainewoods Posted March 8, 2007 Share Posted March 8, 2007 I just posted this for someone else. Your should be able to convert it for your uses. --Turn on the Loading message just before calling Ajax.Updater and then use the 'onComplete' option in the Ajax.Updater to turn it off: function send(){ /* displays the loading message */ document.getElementById("theLoadingMessageID").style.display = ""; var params = Form.serialize($('commentsForm')); new Ajax.Updater('commentdiv', 'comments.php', { onComplete:function(){ /* turn off loading message */ document.getElementById("theLoadingMessageID").style.display = "none"; }, asynchronous:true, parameters:params } ); } http://wiki.script.aculo.us/scriptaculous/show/Ajax.Updater Link to comment https://forums.phpfreaks.com/topic/39545-help-to-put-a-loading-with-prototype/#findComment-202218 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.