|
|
#1 (permalink) |
|
Registered User
Fresh Surpasser
Joined in Aug 2004
Lives in Poland
Hosted on pass7
21 posts
Gave thanks: 0
Thanked 0 times
|
AJAX from prototype 1.5 final does'n work
Hi
I use prototype 1.5 final library and I have problem with AJAX requests (all returns error 403). In prototype 1.5 Release Candidate 0 AJAX requests works correct. The problem occurs only on Surpass account. On my local machine and other servers (i checked 2 servers from different firms) prototype 1.5 final works correct so I'm afraid it may be the server configuration error. Had anyone got similar problem? Any solutions?
__________________
Jacek Czapla<br/> pass60 |
|
|
|
|
|
#3 (permalink) |
|
Registered User
Fresh Surpasser
Joined in Aug 2004
Lives in Poland
Hosted on pass7
21 posts
Gave thanks: 0
Thanked 0 times
|
OK. This is link element with ajax request.
As you can see onClick returns null, and link behavior is done by Event.observe function from Prototype library. This code is generated by helper method of CakePHP Framework. <a href="/clientgroups/index" id="link23617" onclick=" return false;">Client groups</a><script type="text/javascript">Event.observe('link23617', 'click', function(event){ new Ajax.Updater('content-center','/clientgroups/index', {asynchronous:true, evalScripts:true, requestHeaders:['X-Update', 'content-center']}) }, false);</script> I found an answer. Prototype 1.5 final send this content-type header Content-Type: application/x-www-form-urlencoded; charset=UTF-8 version 1.5 RC0 send Content-Type: application/x-www-form-urlencoded IO changed the Prototype code (class Ajax.Request.Events method setRequestHeaders) from: headers['Content-type'] = this.options.contentType + (this.options.encoding ? '; charset=' + this.options.encoding : ''); to: headers['Content-type'] = this.options.contentType; Now all works correct. Thanks for bring me to thinking. :-)
__________________
Jacek Czapla<br/> pass60 |
|
|
|