28个常用JavaScript方法集锦(3)


var tmp = window.open("about:blank", "", "fullscreen=1")
                            tmp.moveTo(0, 0);
                            tmp.resizeTo(screen.width + 20, screen.height);
                            tmp.focus();
                            tmp.location.href = 'http://www.che168.com/pinggu/eva_' + msgResult.message[0] + '.html';
 
var config_ = "left=0,top=0,width=" + (window.screen.Width) + ",height=" + (window.screen.Height);
                            window.open('http://www.che168.com/pinggu/eva_' + msgResult.message[0] + '.html', "winHanle", config_);
//模拟form提交打开新页面
var f = document.createElement("form");
                            f.setAttribute('action', 'http://www.che168.com/pinggu/eva_' + msgResult.message[0] + '.html');
                            f.target = '_blank';
                            document.body.appendChild(f);
                            f.submit();

/*   全选/全不选  */

复制代码 代码如下:


function selectAll(objSelect) {
            if (objSelect.checked == true) {
                $("input[name='chkId']").attr("checked", true);
                $("input[name='chkAll']").attr("checked", true);
            }
            else if (objSelect.checked == false) {
                $("input[name='chkId']").attr("checked", false);
                $("input[name='chkAll']").attr("checked", false);
            }
        }

  

/* js 判断浏览器  */

复制代码 代码如下:


判断是否是 IE 浏览器
    if (document.all){
        alert(”IE浏览器”);
    }else{
        alert(”非IE浏览器”);
    }
    if (!!window.ActiveXObject){
        alert(”IE浏览器”);
    }else{
        alert(”非IE浏览器”);
    }
判断是IE几
var isIE=!!window.ActiveXObject;
var isIE6=isIE&&!window.XMLHttpRequest;
var isIE8=isIE&&!!document.documentMode;
var isIE7=isIE&&!isIE6&&!isIE8;
if (isIE){
    if (isIE6){
        alert(”ie6″);
    }else if (isIE8){
        alert(”ie8″);
    }else if (isIE7){
        alert(”ie7″);
    }
}

  

/* 判断浏览器 */

复制代码 代码如下:

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wgxwsf.html