mirror of
https://github.com/Yetangitu/ampache
synced 2025-10-06 03:49:56 +02:00
many hours for so little code
This commit is contained in:
parent
8257b8bd4b
commit
5d8360f53d
1 changed files with 36 additions and 5 deletions
|
@ -1,10 +1,9 @@
|
|||
// Copyright Ampache.org 2001 - 2006
|
||||
// All Rights Reserved
|
||||
// Origional Author Kevin Riker
|
||||
// Updated to handle post and XML Get by Karl Vollmer
|
||||
// Published under the GNU GPL
|
||||
|
||||
//var xmlDoc = null;
|
||||
// Origional Author: Kevin Riker
|
||||
// Added Multi-Value XML based GET/POST replacement * Karl Vollmer
|
||||
// Licensed under the GNU/GPL
|
||||
|
||||
var http_request = false;
|
||||
var IE = true;
|
||||
|
||||
|
@ -66,3 +65,35 @@
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
function ajaxPost(url,input,output) {
|
||||
|
||||
var post_data = 'a=0';
|
||||
|
||||
for(i=0;i<input.length;i++) {
|
||||
post_data = post_data +'&' + input[i] + '=' + encodeURI(document.getElementById(input[i]).value);
|
||||
}
|
||||
var http_request = false;
|
||||
if (window.XMLHttpRequest) { // Mozilla, Safari,...
|
||||
http_request = new XMLHttpRequest();
|
||||
} else if (window.ActiveXObject) { // IE
|
||||
try {
|
||||
http_request = new ActiveXObject("Msxml2.XMLHTTP");
|
||||
} catch (e) {
|
||||
try {
|
||||
http_request = new ActiveXObject("Microsoft.XMLHTTP");
|
||||
} catch (e) {}
|
||||
}
|
||||
}
|
||||
if (!http_request) {
|
||||
return false;
|
||||
}
|
||||
http_request.onreadystatechange = function() { getContents(http_request,output); };
|
||||
http_request.open('POST', url, true);
|
||||
http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
||||
http_request.setRequestHeader("Content-length", post_data.length);
|
||||
http_request.setRequestHeader("Connection", "close");
|
||||
http_request.send(post_data);
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue