How can I change default AJAX settings?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How can I change default AJAX settings?

Mariano Martinez Peck
Hi guys, 

I have a few places where I am reaching the limit of URL size due to AJAX serialziation. I can manually fix the places where I serialize a bunch and do:

jQuery ajax type: 'POST';
serializeForm;
...

But I am wondering if I can change this globally, for all AJAX requests. I tried this:

 html jQuery ajaxSetup type: 'POST'  

But doesn't seem to work. Does someone know how to?

In addition, I wonder, is it a bad idea to set 'POST' as default?

Thanks in advance, 


_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How can I change default AJAX settings?

Paul DeBruicker
At the bottom of the page in the footer I have this:



html document
    addLoadScript:
      (html jQuery document
        onAjaxSend: (html jQuery class: 'spinner') show;
        onAjaxComplete: (html jQuery class: 'spinner') hide;
        onAjaxError:
            (self ajaxErrorHandler asFunction: #('event' 'jqxhr' 'settings' 'exception')))


So I think all you're missing is the #document send in there.  




Also on a case by case basis you can use POST rather than GET if you do a


html textInput
   onChange: html jQuery post serializeThis;
   on: #mvVar of: self.


I'm not sure of the trade-offs of using POST all the time vs GET but I think for Seaside it won't hurt.  Probably :)




Mariano Martinez Peck wrote
Hi guys,

I have a few places where I am reaching the limit of URL size due to AJAX
serialziation. I can manually fix the places where I serialize a bunch and
do:

jQuery ajax type: 'POST';
serializeForm;
...

But I am wondering if I can change this globally, for all AJAX requests. I
tried this:

 html jQuery ajaxSetup type: 'POST'

But doesn't seem to work. Does someone know how to?

In addition, I wonder, is it a bad idea to set 'POST' as default?

Thanks in advance,


--
Mariano
http://marianopeck.wordpress.com

_______________________________________________
seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside