js多次调用只有一次有效

https://blog.csdn.net/feijiges/article/details/77949502

function ios_weixin(){
        ios_weixin_flag = false;
        var u = navigator.userAgent;
        var isiOS = !!u.match(/(i[^;]+;( U;)? CPU.+Mac OS X/);
        if(isiOS){
            console.log(0);
        }
    }
    if(window.ios_weixin_flag==undefined){
        window.ios_weixin_flag = true;
        ios_weixin();
    }
原文地址:https://www.cnblogs.com/beimingbingpo/p/10114591.html