54dev
V2EX  ›  V2EX

v2ex.js 里的一个 bug?

  •  
  •   54dev · Nov 4, 2015 · 2797 views
    This topic created in 3868 days ago, the information mentioned may be changed or developed.
    function dispatch() {
        var q = document.getElementById("q");
        if (q.value != "") {
            var url = 'http://www.google.com/search?q=site:v2ex.com/t%20' + q.value;
            if (navigator.userAgent.indexOf('iPad') > -1 || navigator.userAgent.indexOf('iPhone') > -1 || navigator.userAgent.indexOf('iPhone') > -1) {
                location.href = url;
            } else {
                window.open(url, "_blank");
            }
            return false;
        } else {
            return false;
        }
    }
    
    if (navigator.userAgent.indexOf('iPad') > -1 ||
    navigator.userAgent.indexOf('iPhone') > -1 ||
    navigator.userAgent.indexOf('iPhone') > -1)   //判断两次?
    
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   6181 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 53ms · UTC 02:10 · PVG 10:10 · LAX 19:10 · JFK 22:10
    ♥ Do have faith in what you're doing.