Oh, thanks Louis. I tried again by using your method. It really works! I mean, request.is_ajax() is working now. Also, I found the real cause why I encountered that problem. I used 'GET' method to request a view in ajax but that view is CACHED by my browser before ajax request it, so I get the same result even I really used ajax. I changed to 'POST' method in ajax function and that works fine. Again, thanks all you guys.
On Fri, Apr 25, 2008 at 11:07 PM, Louis Orenstein <[EMAIL PROTECTED]> wrote: > Could you print out what the request.META.get('HTTP_X_REQUESTED_WITH') > method returns? Maybe the request doesn't have that property set correctly, > or maybe the HTTP_X_REQUESTED_WITH value isn't the proper thing to "get" > from META ? > > > Patrick Lv wrote: > > Hi Alex, > > What I am talking about is this: > > http://code.djangoproject.com/ticket/6616 > > On Sat, Apr 19, 2008 at 10:28 PM, Alex Koshelev <[EMAIL PROTECTED]> > wrote: > > > > > What is `is_ajax` method? > > > > On Apr 19, 4:06 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> > > wrote: > > > I have made up a view to check a request is ajax or not, but the > > > function is_ajax() always return false. I used prototype to fire the > > > ajax request and I confirmed it with Firebug. The request header > > > really contains "X-Requested-With" and its value is "XMLHttpRequest". > > > I tried it many times on different machines (Win XP+Django dev server > > > and Debian+Apache 2+FastCGI) but the problem remained as the same. I > > > checked the request.META, but can not find any string like ""X- > > > Requested-With", so I think that is the real cause. > > > > > > Does anyone see the same problem as me? > > > > > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---