I had some pyramid code that used 'request.route_path()' in the 'href=' portion of an anchor tag to open a slide-in on my webpage. In the view handler I had a check for 'request.is_xhr' which called 'render_to_response()' so I could change my renderer appropriately. This worked correctly when the view was accessed via the request.route_path().
I now need to change the functionality a bit so I can first check if the user is on a mobile device via jQuery. So the 'href=' now invokes a javascript function which then uses Ajax to access the view handler. Basically, I had request.route_path('slide_in', arg1=data, arg2=data2) and now have an ajax call where the url is '/slide_in/data/data2'. This seems to work as the view handler is invoked and the request.is_xhr check is set to True, as it should be. The problem I have is that the call to render_to_response() doesn't fail, but doesn't seem to do anything either because I end up with a blank page when using Ajax. It works fine with the original 'request.route_path()'.
Does anyone have insight as to why this might be? The headers and everything are identical in both situations and the request object is valid, but the Ajax initiated call results in a blank page. Thanks for any thoughts as I am new to this and have tried LOTS of different ideas but am quite stuck.