Struggling with return from javascript

Hi

I am not experienced with javascript as you can probably tell :slight_smile:

I have the following script which returns and loads a PHP form into a div dependent upon the category selected, and is called by an on change event. All works OK on a web browser but it does not work on mobile devices. Can somebody give me some pointers as to how I can resolve this.

$(document).ready( function(){

//Reset dropdown on page load    
$('.home_cat_id').val(0);
 
// Check if value has changed //
$(".home_cat_id").on("change", function(){
    
 
// Pass the form values to the homepage_search.html file    
$.post('/includes/homepage_search.html', $("select[name='home_cat_id']").serialize(), function(ret){
 
// Detect if values have been passed back    
    if(ret!=""){
    $('.search').html(ret);
    } else {
       alert('ERROR');
    }
 
});
 
return false;
 
}); 
});

Thanks for your time.