javascript - JQuery AJAX Post Freezing/Timeout on Mobile Devices -


i'm using jquery's ajax post post data form external crm. there asp.net c# code behind handles external url.

i've done ajax posts using same method , have never ran problem. works fine on desktop browsers, freezes on ipads/iphones , times out on android devices.

here code post:

function mfsubmit(event) {     event.preventdefault();     if (mfvalidateform4() == true) {     $('a#aaction').hide();         $('#mfloader').show();         var campaignid = "18";         if ($("#campid").val() != undefined) {             campaignid = $("#campid").val();         }         var referid = function () {             var mynumber = "1";             mynumber = 70000000 + math.floor(math.random() * 70000000);             return mynumber;         };          //alert("campaign: " + campaignid);          $.ajax({             type: "post",             url: "/posthelper.ashx?target=externalurl" + campaignid,             data: {                 firstname: firstname,                 lastname: lastname,                 email: email,                 phone: phone,                 propertyzipcode: zip,                 propertystate: state,                 currentcity: city,                 estimatedhomevalue: estimatedvalue,                 loanamount: loanamount,                 transactiontype: loanpurpose,                 creditrating: creditscore,                 referid: referid             },             success: function (msg) {                 //alert('success');                 var newurl = document.location.href;                 newurl = newurl.replace('#slide-5', '#slide-6');                 document.location.href = newurl;             },             error: function (msg) {                 console.log(msg);                 //alert('error');             },             datatype: 'text'         });     }     return false;  } 

the mfsubmit function being called 'onclick' passes event. externalurl placeholder. also, response server 'success' in text format.

this working on desktop browsers, consistently freeze on apple mobile devices , timeout on android.

any advice or appreciated.

this turned out undeclared variable used in data property of ajax function.

while declaring did fix issue, find strange did not cause issues desktop-based browsers.

i had pretty ruled out since working fine exception of mobile.

live , learn


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -