- Visual C++源码
- Visual Basic源码
- C++ Builder源码
- Java源码
- Delphi源码
- C/C++源码
- PHP源码
- Perl源码
- Python源码
- Asm源码
- Pascal源码
- Borland C++源码
- Others源码
- SQL源码
- VBScript源码
- JavaScript源码
- ASP/ASPX源码
- C#源码
- Flash/ActionScript源码
- matlab源码
- PowerBuilder源码
- LabView源码
- Flex源码
- MathCAD源码
- VBA源码
- IDL源码
- Lisp/Scheme源码
- VHDL源码
- Objective-C源码
- Fortran源码
- tcl/tk源码
- QT源码
global.js
资源名称:web.rar [点击查看]
上传用户:zhouquan
上传日期:2021-05-12
资源大小:16497k
文件大小:2k
源码类别:
WEB源码(ASP,PHP,...)
开发平台:
HTML/CSS
- // JavaScript Document
- function $(id) {
- return document.getElementById(id);
- }
- function Roly() {}
- function AutoFrameHeight(name,def) {
- var iframe = document.getElementById(name);
- if(def == undefined)
- def = 280; //set default height
- if(iframe.readyState == "complete") {
- var height = eval(name).document.body.scrollHeight;
- if(height<def)
- height = def;
- height += 30;
- iframe.style.height=height+"px";
- }
- }
- function forward(URLStr) {
- window.location = URLStr;
- }
- function parentforward(URLStr) {
- self.parent.location = URLStr;
- }
- //日期差值
- Date.prototype.DayDiff = function(cDate,mode){
- try{
- cDate.getYear();
- }catch(e){
- return(0);
- }
- var base =60*60*24*1000;
- var result = Math.abs(this.getTime() - cDate.getTime());
- switch(mode){
- case "y":
- result/=base*365;
- break;
- case "m":
- result/=base*365/12;
- break;
- case "w":
- result/=base*7;
- break;
- default:
- result/=base;
- break;
- }
- return(Math.floor(result));
- }
- //打开加载窗口
- function callLoadingBox(button,left,top) {
- var loadDiv = document.createElement("div");
- loadDiv.id = "loadDiv";
- loadDiv.className = "load";
- loadDiv.appendChild(document.createTextNode("加载中,请稍等"));
- if(left!=null && top!=null) {
- loadDiv.style.left = left;
- loadDiv.style.top = top;
- }
- document.body.appendChild(loadDiv);
- if(button!=null) {
- button.disabled = true;
- }
- }
- function getCookie(name) {
- var re = "(?:; )?"+name+"=([^;]*);?";
- var oRE = new RegExp(re);
- if(oRE.test(document.cookie)) {
- return decodeURIComponent(RegExp["$1"]);
- }else{
- return null;
- }
- }
- function AutomateExcel(table) {
- // Start Excel and get Application object.
- try {
- var oXL = new ActiveXObject("Excel.Application");
- // Get a new workbook.
- var oWB = oXL.Workbooks.Add();
- var oSheet = oWB.ActiveSheet;
- var sel=document.body.createTextRange();
- sel.moveToElementText(table);
- sel.select();
- sel.execCommand("Copy");
- oSheet.Paste();
- oXL.Visible = true;
- oXL.Visible = true;
- oXL.UserControl = true;
- } catch (e) {
- alert("请确定已安装Excel2000,IE6.0(或更高版本),并且IE安全设置中对ActiveX控件设置为启用!");
- }
- }
- function setChineseCode(source) {
- return encodeURI(source);
- }