gvpm Posted March 7, 2007 Share Posted March 7, 2007 hello i have obtained the prototype.js and using it for my comments the problem is im not to good with js. i want this code: <script type="text/javascript"> function send(){ var params = Form.serialize($('commentsForm')); new Ajax.Updater('commentdiv', 'comments.php', {asynchronous:true, parameters:params,}); } </script> to basically when i click my submit buttin a loading image appear...if anyone have already posted this im sorry for the repost i tried searching .... thanks. Link to comment https://forums.phpfreaks.com/topic/41670-hello-everyone-ajax-newbie/ Share on other sites More sharing options...
mainewoods Posted March 8, 2007 Share Posted March 8, 2007 --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/41670-hello-everyone-ajax-newbie/#findComment-202214 Share on other sites More sharing options...
gvpm Posted March 8, 2007 Author Share Posted March 8, 2007 thank you soooooooooooooooooooo much i just learnt something new and im going to read that wiki so i can learn some more i really appreicate it. Link to comment https://forums.phpfreaks.com/topic/41670-hello-everyone-ajax-newbie/#findComment-202376 Share on other sites More sharing options...
mainewoods Posted March 8, 2007 Share Posted March 8, 2007 Good luck! Link to comment https://forums.phpfreaks.com/topic/41670-hello-everyone-ajax-newbie/#findComment-202815 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.