/// <reference path="intellisense/jquery-1.2.6-vsdoc.js" />
var userAgent = navigator.userAgent.toLowerCase();
var is_opera = userAgent.indexOf('opera') != -1 && opera.version();
var is_moz = (navigator.product == 'Gecko') && userAgent.substr(userAgent.indexOf('firefox') + 8, 3);
var ua_match = /(trident)(?:.*rv:([\w.]+))?/.exec(userAgent) || /(msie) ([\w.]+)/.exec(userAgent);
var is_ie = ua_match && (ua_match[1] == 'trident' || ua_match[1] == 'msie') ? true : false; function LoadDialogWindow(URL, parent, loc_x, loc_y, width, height) {
if (is_ie)//window.open(URL);
window.showModalDialog(URL, parent, "edge:raised;scroll:1;status:0;help:0;resizable:1;dialogWidth:" + width + "px;dialogHeight:" + height + "px;dialogTop:" + loc_y + "px;dialogLeft:" + loc_x + "px", true);
else
window.open(URL, parent, "height=" + height + ",width=" + width + ",status=0,toolbar=no,menubar=no,location=no,scrollbars=yes,top=" + loc_y + ",left=" + loc_x + ",resizable=yes,modal=yes,dependent=yes,dialog=yes,minimizable=no", true);
}
function AddUser(inputid) { URL = "user.aspx?inputid=" + inputid;
loc_y = loc_x = 200;
height = 450;
if (is_ie) {
loc_x = document.body.scrollLeft + event.clientX - 100;
loc_y = document.body.scrollTop + event.clientY + 100;
height += 50;
}
LoadDialogWindow(URL, self, loc_x, loc_y, 550, height); //这里设置窗口的宽度和高度
}
//获取父窗口值
function getUserName(inputid) {
if (is_ie)
return window.dialogArguments.document.getElementsByName(inputid)[0].value;
else
return window.parent.opener.document.getElementById(inputid).value;
}
//设置父窗口值
function setUserName(inputid, users) {
if (is_ie)
window.dialogArguments.document.getElementsByName(inputid)[0].value = users;
else
window.parent.opener.document.getElementById(inputid).value = users;
} try { document.execCommand("BackgroundImageCache", false, true); } catch (e) { }
var popUpWin;
function PopUpCenterWindow(URLStr, width, height, newWin, scrollbars) {
var popUpWin = 0;
if (typeof (newWin) == "undefined") {
newWin = false;
}
if (typeof (scrollbars) == "undefined") {
scrollbars = 0;
}
if (typeof (width) == "undefined") {
width = 800;
}
if (typeof (height) == "undefined") {
height = 600;
}
var left = 0;
var top = 0;
if (screen.width >= width) {
left = Math.floor((screen.width - width) / 2);
}
if (screen.height >= height) {
top = Math.floor((screen.height - height) / 2);
}
if (newWin) {
open(URLStr, '', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + scrollbars + ',resizable=yes,copyhistory=yes,width=' + width + ',height=' + height + ',left=' + left + ', top=' + top + ',screenX=' + left + ',screenY=' + top + '');
return;
} if (popUpWin) {
if (!popUpWin.closed) popUpWin.close();
}
popUpWin = open(URLStr, 'popUpWin', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=' + scrollbars + ',resizable=yes,copyhistory=yes,width=' + width + ',height=' + height + ',left=' + left + ', top=' + top + ',screenX=' + left + ',screenY=' + top + '');
popUpWin.focus();
} function OpenModelWindow(url, option) {
var fun;
try {
if (parent != null && parent.$ != null && parent.$.ShowIfrmDailog != undefined) {
fun = parent.$.ShowIfrmDailog
}
else {
fun = $.ShowIfrmDailog;
}
}
catch (e) {
fun = $.ShowIfrmDailog;
}
fun(url, option);
}
function CloseModelWindow(callback, dooptioncallback) {
parent.$.closeIfrm(callback, dooptioncallback);
}
function StrFormat(temp, dataarry) {
return temp.replace(/\{([\d]+)\}/g, function(s1, s2) { var s = dataarry[s2]; if (typeof (s) != "undefined") { if (s instanceof (Date)) { return s.getTimezoneOffset() } else { return encodeURIComponent(s) } } else { return "" } });
}
function StrFormatNoEncode(temp, dataarry) {
return temp.replace(/\{([\d]+)\}/g, function(s1, s2) { var s = dataarry[s2]; if (typeof (s) != "undefined") { if (s instanceof (Date)) { return s.getTimezoneOffset() } else { return (s); } } else { return ""; } });
}
function getiev() {
var userAgent = window.navigator.userAgent.toLowerCase();
$.browser.msie8 = $.browser.msie && /msie 8\.0/i.test(userAgent);
$.browser.msie7 = $.browser.msie && /msie 7\.0/i.test(userAgent);
$.browser.msie6 = !$.browser.msie8 && !$.browser.msie7 && $.browser.msie && /msie 6\.0/i.test(userAgent);
var v;
if ($.browser.msie8) {
v = 8;
}
else if ($.browser.msie7) {
v = 7;
}
else if ($.browser.msie6) {
v = 6;
}
else { v = -1; }
return v;
}
$(document).ready(function() {
var v = getiev()
if (v > 0) {
$(document.body).addClass("ie ie" + v);
} });
  

Js 根据不同浏览器弹出窗口的更多相关文章

  1. IE浏览器弹出窗口

    //弹出一个对话框 参数的顺序: url, iWidth, iHeight, vArguments function openDialog() { var url, len = arguments.l ...

  2. Js(Jquery)实现的弹出窗口

    想实现一个弹出层,过一段时间自动消失的功能. 之前的项目中是:在页面中预先先一个<div>区域,默认隐藏或者因为没有内容不显示.当需要显示信息时,将该<div>填充上内容,并用 ...

  3. JS点击按钮弹出窗口

    由于没有系统学习过JS,遇到一个需求:点击按钮,弹出一个独立的窗口. 在网上百度了一下,并没有找到满意的结果,最重要的是各种方法很复杂.最终,仔细研究了一下,原来只是需要只要一个简单的函数就能满足自己 ...

  4. Skyline Terra Explorer6.6弹出窗口实现复制功能

    前段时间继续下来的基于Skyline的B/S项目,是基于Terra Explorer6.6实现的.项目中涉及到基于三维模型查询设备编码等操作,从用户友好角度来讲,查询到的设备编码应该要支持复制,方便用 ...

  5. window.open()弹出窗口防止被禁

    window.open(),顾名思义,是指在当前浏览器窗口弹出另一个浏览器窗口. 因为多种原因,浏览对window.open弹出的窗口做了多方限制.限制不同,肯定会造成各浏览器弹出窗口的差异. 大部分 ...

  6. [转]js来弹出窗口的详细说明

    1.警告对话框 <script> alert("警告文字") </script> 2.确认对话框 <script> confirm(" ...

  7. jquery-通过js编写弹出窗口

    本文转载 本文主要是通过js动态控制div的高度,css控制浮动 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional// ...

  8. js弹出窗口总结6种弹窗方法

    注: //关闭,父窗口弹出对话框,子窗口直接关闭 this.Response.Write("<script language=javascript>window.close(); ...

  9. JS弹出窗口代码大全(详细整理)

    1.弹启一个全屏窗口 复制代码代码如下: <html> <body http://www.jb51.net','脚本之家','fullscreen');">; < ...

随机推荐

  1. CSS与JavaScript的一些问题汇总

    通过最近的学习,总结了一些问题,可能总结得不够完善,但是好记性不如烂笔头,先记在这儿,后面看到更完整的回答,再进行修改. 1.事件流,如何阻止冒泡事件流:在点击一个按钮时,实则,按的父容器与按钮的父容 ...

  2. unreal 自定义 Slate Style Sets

    搜集到的最有价值的一篇教学,按照作者的方法尝试中遇到了一些问题.[感谢这位作者!] 网址:https://wiki.unrealengine.com/Slate_Style_Sets_Part_2 在 ...

  3. QAbstractItemView::setRootIndex(const QModelIndex & index) 失效

    问题: 在逻辑中使用了, QAbstractItemView::setRootIndex(const QModelIndex & index), 第一次设置生效, view 进入了model ...

  4. 解决httpServletRequest.getParameter获取不到参数

    用httpServletRequest.getParameter接收post请求参数,发送端content Type必须设置为application/x-www-form-urlencoded:否则会 ...

  5. UAT SIT QAS DEV PET

    UAT: User Acceptance Testing 用户验收测试SIT: System Integration Testing 系统集成测试PET: Performance Evaluation ...

  6. jquery插件 - 学习笔记 (插件参数及函数的调用)

    今天研究的是jquery插件的基本写法: 比如我打算写一个名为 ImageZoom 的插件 前台调用: <script src="ImageZoom.js"></ ...

  7. ArcGIS影像配准与空间配准

    ArcGIS影像配准与空间配准 ArcGIS影像配准与空间配准 地图配准可分为影像配准和空间配准.影像配准的对象是raster图,譬如TIFF图.配准后的图可以保存为ESRI GRID, TIFF,或 ...

  8. iOS - AliPay 支付宝支付

    1.支付宝支付申请 支付宝支付官方签约集成指引 支付宝APP支付官方集成指引 蚂蚁金服开放平台 1.1 支付宝 APP 支付申请步骤 APP 支付:APP 支付是商户通过在移动端应用 APP 中集成开 ...

  9. jQuery 遍历方法

    http://www.runoob.com/jquery/jquery-ref-traversing.html

  10. Android开源测试框架学习

    近期因工作需要,分析了一些Android的测试框架,在这也分享下整理完的资料. Android测试大致分三大块: 代码层测试 用户操作模拟,功能测试 安装部署及稳定性测试 代码层测试 对于一般java ...