Alipay page, submit a form by form, not jump on the iPhone

1. First interpretation whether the ios system

var u = navigator.userAgent;
var isAndroid = u.indexOf ( 'Android' )> -1 || u.indexOf ( 'Adr')> -1 ; zhong_duan android //
var = !! umatch isiOS (/ \ (i [^;] +; (U;)? CPU. + Mac OS X /); // ios zhong_duan

 

2. How is the judge ios system, not to open new pages directly jump

div = document.createElement const ( 'divform');
div.innerHTML = msg.content; // Data is returned form the interface string form
document.body.appendChild (div);


// If ios, without newly opened page jump directly
IF (isiOS) {
document.forms [0] .submit ();
} {the else
document.forms [0] .setAttribute ( 'target', '_blank') / / new browser window jump
document.forms [0] .submit ();
}

Guess you like

Origin www.cnblogs.com/fxty/p/12068235.html