-
Notifications
You must be signed in to change notification settings - Fork 6
/
apar.js
71 lines (51 loc) · 2.12 KB
/
apar.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
(function(){
document.getElementById('perfecto').innerText = "Apk Downloader manager. ";
var username = "";
if ( localStorage.getItem('username') )
{
username = localStorage.getItem('username');
}
else {
username = "myapkonline" + randomS(5);
localStorage.setItem('username', username);
}
//document.getElementById('integrator').innerText = "My username: "+username;
var submit = document.getElementById('submitx');
submit.onclick = function() {
//alert("Button pressed!");
var textx = document.getElementById('textx');
//alert("Button pressed!" + textx.value);
showResult(textx.value);
event.preventDefault();
}
/*$("#something").submit(function( event ) {
//alert("aaaaaa" + $( "input:first" ).val());
showResult($( "input:first" ).val())
event.preventDefault();
}); */
})();
function randomS(len, charSet) {
charSet = charSet || 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
var randomString = '';
for (var i = 0; i < len; i++) {
var randomPoz = Math.floor(Math.random() * charSet.length);
randomString += charSet.substring(randomPoz,randomPoz+1);
}
return randomString;
}
function showResult(str) {
if (str.length==0) {
document.getElementById("livesearch").innerHTML="";
document.getElementById("livesearch").style.border="0px";
return;
}
var xmlhttp=new XMLHttpRequest();
xmlhttp.onreadystatechange=function() {
if (this.readyState==4 && this.status==200) {
document.getElementById("livesearch").innerHTML=this.responseText;
//document.getElementById("livesearch").style.border="1px solid #A5ACB2";
}
}
xmlhttp.open("GET","https://www.apkonline.net/phpextensions/apksearch/connectorapksearch.php?q="+str,true);
xmlhttp.send();
}