dlf1987 Posted May 14, 2007 Share Posted May 14, 2007 could sum1 help me add a show hide feature to this function... its a sortable lists from phpriot, how could you make it so that when this function starts its shows a div saying "updating database", and when the function ends it hides the div. function updateOrder() { // turn on update message here var options = { method : 'post', parameters : Sortable.serialize('movies_list'), onComplete : function(request) { // turn off update message here } }; new Ajax.Request('processor.php', options); } i commented where i think ??? the on off should go hope it makes since... thanks! Link to comment https://forums.phpfreaks.com/topic/51342-solved-show-hide-loading/ Share on other sites More sharing options...
dlf1987 Posted May 15, 2007 Author Share Posted May 15, 2007 bump :'( Link to comment https://forums.phpfreaks.com/topic/51342-solved-show-hide-loading/#findComment-253628 Share on other sites More sharing options...
xenophobia Posted May 17, 2007 Share Posted May 17, 2007 I don't know what type of Ajax library you are using. :-\ It seems like you need a status teller to tell you what is the AJAX status right now. For the most commonly, it should be like this: httpRequest.onreadystatechange = handle; function handle(){ if(httpRequest.readyState == 4){ //done loading. }else{ //loading... } } Link to comment https://forums.phpfreaks.com/topic/51342-solved-show-hide-loading/#findComment-255552 Share on other sites More sharing options...
mainewoods Posted May 18, 2007 Share Posted May 18, 2007 function updateOrder() { // turn on update message here document.getElementById('yourdivID').innerHTML = 'updating...'; var options = { method : 'post', parameters : Sortable.serialize('movies_list'), onComplete : function(request) { // turn off update message here document.getElementById('yourdivID').innerHTML = ''; } }; new Ajax.Request('processor.php', options); } create a div somewhere in your page with id="yourdivID" Link to comment https://forums.phpfreaks.com/topic/51342-solved-show-hide-loading/#findComment-256564 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.