PageSourceSearch

https://bifshop.co.kr/jscript/ajax.js

js bifshop.co.kr collected 2026-10-06 13:26:49 UTC 2,474 bytes, 92 lines download raw bytes

1var ajax;
2
3function Ajax(async) {
4	this.XmlHttpReq = null;
5	this.async = (typeof(async)=='undefined')?true:async;
6	this.type = null;
7	this.url = null;
8	this.param = null;
9	this.returnExec = null;
10	this.iswait = false;
11
12	this.encodeParam = function(value) {
13		value = escape(value);
14		value = value.replace(/\+/g, '%2B');
15		return value;
16	}
17
18	this.getXmlHttpRequest = function() {
19		if (window.XMLHttpRequest) {
20			// Create XMLHttpRequest object in non-Microsoft browsers
21			this.XmlHttpReq = new XMLHttpRequest();
22		} else if (window.ActiveXObject) {
23			// Create XMLHttpRequest via MS ActiveX
24			try {
25				// Try to create XMLHttpRequest in later versions
26				// of Internet Explorer
27				this.XmlHttpReq = new ActiveXObject("Msxml2.XMLHTTP");
28			} catch (e1) {
29				// Failed to create required ActiveXObject
30				try {
31					// Try version supported by older versions
32					// of Internet Explorer
33					this.XmlHttpReq = new ActiveXObject("Microsoft.XMLHTTP");
34				} catch (e2) {
35					// Unable to create an XMLHttpRequest with ActiveX
36				}
37			}
38		}
39	}
40
41	this.execute = function(type, url, param, returnExec) {
42		var self = this;
43		if (this.iswait){
44			setTimeout(function() { self.execute(type, url, param, returnExec) }, 200);
45			return;
46		}
47
48		url += ((url.indexOf('?') >= 0) ? '&' : '?') + "rnd="+Math.random();
49
50		this.type = type;
51		this.url = url;
52		this.param = param;
53		this.returnExec = returnExec;
54
55		this.getXmlHttpRequest();
56		this.iswait = true;
57
58		try {
59			return this._execute();
60		}
61		catch (e){}
62	}
63
64	this._execute = function() {
65		var self = this;
66		var result = null;
67
68		if (this.type == "GET") {
69			this.XmlHttpReq.open("GET", this.url, this.async);
70		}
71		else if (this.type == "POST") {
72			this.XmlHttpReq.open("POST", this.url, this.async);
73			this.XmlHttpReq.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
74		}
75
76		this.XmlHttpReq.onreadystatechange = function() {
77			// readyState 가 4 고 status 가 200 일 경우 올바르게 가져옴
78			if (self.XmlHttpReq.readyState == 4 && self.XmlHttpReq.status == 200) {
79				result = self.XmlHttpReq.responseText;
80				if (self.returnExec) eval(self.returnExec+"(result);");
81				self.iswait = false;
82			}
83		}
84
85		if(this.type == 'GET') this.XmlHttpReq.send(null);
86		else if(this.type == 'POST') this.XmlHttpReq.send(this.param);
87	}
88}
89
90function defineAjax() {
91	if (!ajax) ajax = new Ajax();
92}

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.