Compare commits
1 Commits
4c0d652787
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 4de2104d11 |
@ -1,5 +1,5 @@
|
|||||||
//var ScriptName='../api/dbms/v09/records.xyz'; //POST
|
//var ScriptName='../api/dbms/v09/records.xyz'; //POST
|
||||||
//var ScriptDName='../download';
|
//var ScriptDName='../download';
|
||||||
//var ScriptUName='../upload';
|
//var ScriptUName='../upload';
|
||||||
//var ScriptRName='../reports'; //GET For download reports (?file=name)
|
//var ScriptRName='/api/dbms/v09/reports'; //GET For download reports (?file=name)
|
||||||
//var ScriptSName='../session';
|
//var ScriptSName='../session';
|
||||||
|
|||||||
@ -255,6 +255,20 @@ function loadContent(url,obj)
|
|||||||
req.send( null );
|
req.send( null );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function getJsonData(url, callback) {
|
||||||
|
fetch(url)
|
||||||
|
.then(response => {
|
||||||
|
if (!response.ok) {
|
||||||
|
throw new Error("Error HTTP: " + response.status);
|
||||||
|
}
|
||||||
|
return response.json();
|
||||||
|
})
|
||||||
|
.then(data => callback(data))
|
||||||
|
.catch(error => console.error("Fetch error:", error));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//POST Json Data to server
|
//POST Json Data to server
|
||||||
function postJsonData(url,data,fun){
|
function postJsonData(url,data,fun){
|
||||||
if(typeof data !== 'string') {
|
if(typeof data !== 'string') {
|
||||||
@ -291,6 +305,7 @@ function postJsonData(url,data,fun){
|
|||||||
req.setRequestHeader("Content-type", "application/json");
|
req.setRequestHeader("Content-type", "application/json");
|
||||||
req.send(data);
|
req.send(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
//POST Json Data to server
|
//POST Json Data to server
|
||||||
function postXMLData(url,data,fun){
|
function postXMLData(url,data,fun){
|
||||||
if(typeof data !== 'string') {
|
if(typeof data !== 'string') {
|
||||||
|
|||||||
Reference in New Issue
Block a user