Recently encountered a problem in the project, there is a login page, click Login, the company two local tyrants gold can not jump normally (but the login request has been sent to the server), other people's phones are normal. The project is also anxious to go online, the heart of this crazy ah. Finally calm down, finally to solve the problem.
Resolution process:
Because the server has received the client's AJAX request, so it depends on whether the client received a response from the server, under the callback Success function alert (Data.code), found that the response is received, and data.code=0, to meet the jump condition, So continue alert in success else, and eventually position the problem to Sessionstorage.setitem (' Loginphone ', loginphone); above, Sessionstorage is H5 's character, Mobile-phone browsers are generally supported, with alert (Sessionstorage), (Sessionstorage.setitem), and alert (typeof (Sessionstorage.setitem)) found to be normal, typeof (Sessionstorage.setitem) is a function, since the existence of sessionstorage, and why can not be normal execution. Finally, through degrees Niang found the root cause of the problem---safari non-trace browsing will affect localstorage. So you just have to change this sentence a little bit.
try { Sessionstorage.setitem ("Loginphone", Loginphone), } catch (e) { alert ("You are in a no-trace view, unable to jump for You"); }
Here is the code before the modification:
var Loginphone; function Submitbindinfo () {if (Checksubmitmobile ($ ("#phone-wrap")) && Checkcode () &&checkcontract ( ) {var param={phone:loginphone, authcode:$ ("#verifycode"). Val () }; $.ajax ({type: "POST", url: "/portal/member/login.do", Data:param, DataType: "JSON", timeout:20000, Error:function (XMLHttpRequest, Textstatus, Errorthrown) { if (xmlhttprequest.status==408) {alert ("The system is busy, please try later"); }else{Alert (xmlhttprequest.status+ "error"); }}, Success:function (data) {dosuccess (data); } }); }} function dosuccess (data) {if (data.code!=0) {loginfailcallback (DATA.DESC); }else{ Sessionstorage.setitem (' Loginphone ', loginphone); DOREDIRCT (); }} function doredirct () {switch (hash) {case "#member": window.location.href= "/po Rtal/member/showmember.do "; Break Case "#myOrder": window.location.href= "/portal/myorder/showorder.do"; Break Case "#myCoupon": window.location.href= "/portal/mycoupon/showcoupon.do"; Break Default:window.location.href= "/portal/sinopec/step0.do"; Break } }
Safari non-trace browsing impact localstorage