[web2py] Re: AJAX in Web2py -> Synchronous
Ohhh, OK, Anthony. Yes, my version is the same. And yes I'm reffering to . I deleted them, because I thought it was for commenting out (nearly everything was greyed out). >From your link: "Old browsers will treat your JS code as one long HTML comment. On the other hand, new JavaScript-aware browsers will normally interpret JS code between the tags and " Thank you for the clarification! Best Regards Phoboss On 28 Jan., 01:17, Anthony wrote: > On Thursday, January 27, 2011 6:55:24 PM UTC-5, Phoboss wrote: > > > OK, I tried to change the code of web2py_ajax.html BUT all function > > code was commented out!! What is going on? > > Here's the file in > trunk:http://code.google.com/p/web2py/source/browse/applications/welcome/vi... > > Is your version the same? When you say the code is commented out, are you > referring to the just inside the script tags? If so, that is > commonly done so that older browsers that don't support Javascript won't end > up displaying the Javascript code as if it were plain text (the opening and > closing HTML comment tags tell the browser to ignore everything in between). > Seehttp://www.javascripter.net/faq/hidingjs.htm. > > Anthony
[web2py] Re: AJAX in Web2py -> Synchronous
On Thursday, January 27, 2011 6:55:24 PM UTC-5, Phoboss wrote: > > OK, I tried to change the code of web2py_ajax.html BUT all function > code was commented out!! What is going on? Here's the file in trunk: http://code.google.com/p/web2py/source/browse/applications/welcome/views/web2py_ajax.html Is your version the same? When you say the code is commented out, are you referring to the just inside the script tags? If so, that is commonly done so that older browsers that don't support Javascript won't end up displaying the Javascript code as if it were plain text (the opening and closing HTML comment tags tell the browser to ignore everything in between). See http://www.javascripter.net/faq/hidingjs.htm. Anthony
[web2py] Re: AJAX in Web2py -> Synchronous
OK, I tried to change the code of web2py_ajax.html BUT all function code was commented out!! What is going on? Why is all commented out? Is it commented out because all the code in web2py_ajax.html is only for changing AJAX-settings? Like turning asynchronisation off? I built my app by using the form field "New simple application". After that the web2py-system makes automatically a copy of the "welcome"- app. And after that I never changed the web2py_ajax.html file! Well, I commented "in" the "function ajax(u,s,t)". Within this function there is the mentioned jQuery-Command: jQuery.ajax({type: "POST", url: u, data: query, async: false, success: function(msg) { if(t) { if(t==':eval') eval(msg); else jQuery("#" + t).html(msg); } } }); So, finally it works now, however, I don't get why everything was commented out. Again, Thank you! Regards Phoboss On 27 Jan., 15:54, Phoboss wrote: > Hi Denes, > > firstly thank you for your swift response! > > I'm now at work. So in 4 hours or so I'll try it at home. > After that I'll report here if it's works. > > Best Regards > > Phoboss > > On 27 Jan., 15:49, DenesL wrote: > > > > > > > > > Hi Phoboss, > > > web2py uses the jQuery.ajax API which has a parameter named async for > > that. > > > Try changing your app's web2py_ajax.html file where the jQuery.ajax > > calls are made and specify async : false . > > > Denes > > > On Jan 27, 3:53 am, Phoboss wrote: > > > > Hi Experts, > > > > how can I turn off asynchron AJAX in web2py? > > > It sounds strange but I need it synchronous! > > > > BTW, I implemented this > > > example:http://www.web2py.com/book/default/chapter/10#Ajax-Form-Submission > > > > Thank you so much! > > > > Best Regards > > > > Phoboss
[web2py] Re: AJAX in Web2py -> Synchronous
Hi Denes, firstly thank you for your swift response! I'm now at work. So in 4 hours or so I'll try it at home. After that I'll report here if it's works. Best Regards Phoboss On 27 Jan., 15:49, DenesL wrote: > Hi Phoboss, > > web2py uses the jQuery.ajax API which has a parameter named async for > that. > > Try changing your app's web2py_ajax.html file where the jQuery.ajax > calls are made and specify async : false . > > Denes > > On Jan 27, 3:53 am, Phoboss wrote: > > > > > > > > > Hi Experts, > > > how can I turn off asynchron AJAX in web2py? > > It sounds strange but I need it synchronous! > > > BTW, I implemented this > > example:http://www.web2py.com/book/default/chapter/10#Ajax-Form-Submission > > > Thank you so much! > > > Best Regards > > > Phoboss
[web2py] Re: AJAX in Web2py -> Synchronous
Hi Phoboss, web2py uses the jQuery.ajax API which has a parameter named async for that. Try changing your app's web2py_ajax.html file where the jQuery.ajax calls are made and specify async : false . Denes On Jan 27, 3:53 am, Phoboss wrote: > Hi Experts, > > how can I turn off asynchron AJAX in web2py? > It sounds strange but I need it synchronous! > > BTW, I implemented this > example:http://www.web2py.com/book/default/chapter/10#Ajax-Form-Submission > > Thank you so much! > > Best Regards > > Phoboss