mobile_fu rendering over AJAX so it seems


mobile_fu rendering over AJAX so it seems



My controller renders regular html, mobile_fu, and javascript as such:

respond_to do |format|   format.html {     render :action => "full", :layout => "application" and return   }   format.mobile {     render :action => "full", :layout => "application" and return   }   format.js {     render :partial => "content", :layout => false and return   } end 

Regular html renders fine, using AJAX from the html version of the site works fine, but using AJAX on the mobile browser seems to always render the format.mobile block. I'm using jQuery when binding it to the click event of a button, and my testing on the iPhone always ends up rendering the format.mobile block above..

$.ajax({           beforeSend      : function(request) { request.setRequestHeader("Accept", "text/javascript"); },           success         : function(response) {             $("#content").append(response);           },           type            : 'GET',           url             : url, //set somewhere else           data            : data //set somewhere else       }); 

Is jQuery not catching the click event (iPhone quirk?) or is mobile_fu taking charge and being a little overbearing here? Anyone already tackled this or see what I'm missing?


What is the best way to download image data from ASP.NET to iphone?

1:

Performance problems on iPhone using simple graphics
Looking at the code for mobile_fu shows this any mobile request coming in will be set to mobile. Converting OpenGL Primitives to OpenGLESChanging line 73 to any thing like this might work:. EXC_BAD_ACCESS error
if is_mobile_device? && !request.xhr? 
casting a NSString to char problemTrying to include iPhone OpenGLES headers in C++ code

2:

Is NSTimer auto retained?
Just in case any one else finds this, if you have different javascript for mobile devices, you must do:. Submit ajax form on keyboard close without a submit button on the iphone?
format.mobile {render :content_type => "application/javascript"} 
(put your js in action.mobile.rjs).


60 out of 100 based on 55 user ratings 770 reviews