PageSourceSearch

https://romedesignawards.com/js/ajax.js

js romedesignawards.com collected 2026-10-05 00:44:21 UTC 2,932 bytes, 97 lines download raw bytes

1	function GetXmlHttpObject(){
2		var xmlHttp=null;
3
4		try {xmlHttp=new XMLHttpRequest();} // Firefox, Opera 8.0+, Safari
5  		catch (e){
6			try {xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");} // Internet Explorer
7			catch (e){
8				try {xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");} // Internet Explorer 5.5
9	  			catch (e) {xmlHttp=null;}
10	  		}
11	  	}
12
13		if (xmlHttp==null) {alert ("Your browser does not support AJAX!");}
14	  	return xmlHttp;
15	}
16
17	//------------------------------------------------------------------------------------------------
18
19	var fld = "";
20	var mtd = "";
21
22	function clearopt(fld){
23		document.getElementById(fld).options.length=0;
24	}
25	function addopt(fld,s,v){
26		var opt = document.createElement('OPTION');
27		opt.text = s;
28		opt.value = v;
29		document.getElementById(fld).options.add(opt);
30	}
31
32	function ajax(fn,q,m,f,msg){
33		if (q=="") return;
34		xmlHttp=GetXmlHttpObject(); if (xmlHttp==null) {return;}
35
36		mtd = m;
37		fld = f;
38
39		if (mtd=="span") {document.getElementById(fld).innerText=msg;}
40		if (mtd=="div") {document.getElementById(fld).innerHTML=msg;}
41		if (mtd=="span2") {
42			document.getElementById(fld).innerHTML=msg+"\n"+
43				"<input type='hidden' name='qids' id='qids' value=''/>\n"+
44				"<input type='hidden' value='0' id='sd' name='sd' />\n"+
45				"<input type='hidden' value='0' id='dop' name='dop' />\n"+
46				"<input type='hidden' value='0' id='dofoc' name='dofoc' />\n"+
47				"<input type='hidden' value='43' id='pc' name='pc' />\n"+
48				"";
49			;
50		}
51		var url="__ajax.php";
52
53		url=url+"?fn="+fn;
54		url=url+"&m="+m;
55		url=url+"&f="+f;
56		url=url+"&q="+q;
57		url=url+"&seed="+Math.random();
58		xmlHttp.onreadystatechange=ajaxResponse;
59		xmlHttp.open("GET",url,true);
60		xmlHttp.send(null);
61	}
62
63	function ajaxResponse()  {
64		if (xmlHttp.readyState==4) {
65			if (mtd=="eval") {eval(xmlHttp.responseText);}
66			if (mtd=="span") {document.getElementById(fld).innerHTML=xmlHttp.responseText;}
67			if (mtd=="div") {document.getElementById(fld).innerHTML=xmlHttp.responseText;}
68			if (mtd=="span2") {document.getElementById(fld).innerHTML=xmlHttp.responseText;}
69			if (mtd=="field") {document.getElementById(fld).value=xmlHttp.responseText;}
70
71			if (gebi('btnquote')!=null) {
72				if (xmlHttp.responseText.indexOf("Product Cost")!=-1) {
73					gebi('btnquote').disabled=false;
74				}
75			}
76		}
77
78		$(".atc-btn").click(function(event){
79			var a=this;
80			a.innerHTML='Added to cart';
81			$(a).addClass('added-atc')
82			setTimeout(function(){ a.innerHTML='Add to cart';$(a).removeClass('added-atc')}, 1500);
83			// var x = event.clientX;
84			// var y = event.clientY;
85
86			// $("#cart-plus").removeClass("cart-plus-anim");
87			// $("#cart-plus").addClass("cart-plus-anim");
88			// // $("#cart-plus").fadeIn("slow");
89			// $("#cart-plus").offset({left:x,top:y});
90			// setTimeout(function(){ $("#cart-plus").fadeOut("slow"); }, 1500);
91		})
92
93		function wish(a){
94		  ajax('wish',a,'','','');
95		  $('#wishbtn'+a).hide('fast');
96		}
97	}

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.