File size: 331 Bytes
4cadbaf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17




export default function sendRequest (conf) {
	fetch(conf.url, conf.data).then(res => res.text()).then(data => {
		//console.log("data:", data);
		if (conf.onload)
			conf.onload({ responseText: data });
	}).catch(e => {
		console.warn("DOMLoader.sendRequest error:", e);

		if (conf.onerror)
			conf.onerror(e, false);
	});
};