Re: RequestHandler-isAjax not returning expected data
Jim, thanks for the tip. Although that is not a concern in this scenario, that is definitely good to know. Samuel, I'm just using a little self-written ajax...no libraries. That's probably my issue. Thanks to you both for the help! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
RequestHandler-isAjax not returning expected data
When I perform a test on an ajax call with RequestHandler-isAjax, it is returning false. isAjax calls the env function (line 217 of request_handler.php), passing it a key of HTTP_X_REQUESTED_WITH. However, env does not appear to have any handler for HTTP_X_REQUESTED_WITH (line 1017 of basics.php), causing it to return null and the comparison in isAjax to fail. I performed step by step testing through both the isAjax and env functions, and am fairly certain that I'm using them correctly. In my testing, the ajax call is sending HTTP_X_REQUESTED_WITH, which should trigger isAjax to return true. (Note: I'm not infallible, so I could have messed up somewhere!) Am I doing something wrong, or should I submit a bug report? My environment: Cake 1.2.5427 Apache 2.something Solaris 8 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---
Re: RequestHandler-isAjax not returning expected data
Although I'm not sure what is causing the above behavior, I do have a workaround for it. Whenever I call the controller action via ajax, I append a get variable onto the URL. Then, I just check for that variable to determine if the action was called via ajax or not. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Cake PHP group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~--~~~~--~~--~--~---