PageSourceSearch

https://www.7m.com.cn/js/common.js

js 7m.com.cn collected 2026-10-03 17:35:21 UTC 2,745 bytes, 127 lines download raw bytes

1// JavaScript Document
2
3String.prototype.Trim = function(){return   this.replace(/(^\s*)|(\s*$)/g,"");}   
4String.prototype.Ltrim = function(){return   this.replace(/(^\s*)/g,   "");}   
5String.prototype.Rtrim = function(){return   this.replace(/(\s*$)/g,   "");} 
6
7function $$(objId)
8{
9	if(!objId){
10	//alert($.caller);
11	return null;}
12	return document.getElementById(objId);	
13}
14
15//取元素相对于body的坐标
16function ZB() 
17{
18 this.left=0,
19 this.top=0,
20 this.width=0,
21 this.height=0
22 };
23 
24
25 
26function GetZB(obj)
27{
28	var o=obj;
29	var oLTWH=new ZB();
30	oLTWH.width=o.offsetWidth;
31	oLTWH.height=o.offsetHeight;
32	oLTWH.left=o.offsetLeft;
33	oLTWH.top=o.offsetTop;
34	while(true)
35    {
36       o=o.offsetParent;
37       if(o==(document.body&&null))break;
38       oLTWH.left+=o.offsetLeft;
39       oLTWH.top+=o.offsetTop;
40    }
41    return oLTWH;
42}
43
44
45function urlEncode(str)
46{
47	return encodeURIComponent(str);
48}
49
50
51
52function LoadJS(fileUrl,callback,code) 
53{ 
54    var oHead = document.getElementsByTagName('HEAD').item(0); 
55    var oScript= document.createElement("script"); 
56    oScript.type = "text/javascript";
57	if(code)
58	{
59		oScript.charset="gb2312";
60	}
61    oScript.src=fileUrl ;  
62	oHead.appendChild(oScript); 
63	if(document.addEventListener)
64	{
65		oScript.onload = callback;
66		oScript.onerror = callback;
67	}
68	else
69	{
70		oScript.onreadystatechange =function(){ LoadJsReady(oScript,callback);}; 
71	}
72
73}
74
75
76function LoadJsReady(obj,callBack)
77{
78	if(obj.readyState=="loaded")
79	{
80		callBack();
81	}
82	
83}
84
85function getCookie(c_name)
86{
87	if (document.cookie.length>0)
88	{ 
89		c_start=document.cookie.indexOf(c_name + "=");
90		if (c_start!=-1)
91		{ 
92			c_start=c_start + c_name.length+1 ;
93			c_end=document.cookie.indexOf(";",c_start);
94			if (c_end==-1) c_end=document.cookie.length;
95			return unescape(document.cookie.substring(c_start,c_end));
96		} 
97	}
98	return "";
99}
100
101
102function setCookie(c_name,value,expiredays,domain)
103{
104	var exdate=new Date();
105	exdate.setDate(exdate.getDate()+expiredays);
106	document.cookie=c_name+ "=" +escape(value)+
107	((expiredays=="") ? "" : ";
107 expires="+exdate.toGMTString())  + ((domain=="")?"":";domain=" + domain)  ;
108}
109
110function delCookie(name)
111{
112    var exp = new Date();
113    exp.setTime(exp.getTime() - 1);
114    var cval=getCookie(name);
115    if(cval!=null)document.cookie= name + "="+cval+";expires="+exp.toGMTString() + ";path=/" + ";domain=.7m.com.cn";
116}
117
118
119function isIos()
120{
121	var ua = navigator.userAgent.toLowerCase();
122    return ua.indexOf("ipad") > -1 || ua.indexOf("ipod") > -1 || ua.indexOf("iphone os") > -1;
123}
124function isAndroid(){
125	var ua = navigator.userAgent.toLowerCase();
126	return ua.indexOf("android") > -1;
127}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.