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?