54dev
V2EX  ›  V2EX

v2ex.js 里的一个 bug?

  •  
  •   54dev · Nov 4, 2015 · 2796 views
    This topic created in 3867 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   ·   3014 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 32ms · UTC 08:41 · PVG 16:41 · LAX 01:41 · JFK 04:41
    ♥ Do have faith in what you're doing.