This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ajax = (url, {method="GET", body=null, headers={}, mode}, onProgress=()=>{}, onStartProgress=()=>{}, onStopProgress=()=>{}) => { | |
return new Promise((result, reject) => { | |
const ajax = new XMLHttpRequest(); | |
ajax.open(method, url, true); | |
for(let [key, value] of headers) | |
ajax.setRequestHeader(key, value); | |
if(mode==='cors') | |
ajax.withCredentials = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const print_log = (object, err=false) => { | |
const log = document.createElement("pre"); | |
log.innerHTML = print_r(object); | |
let border ="1px solid #d6d8db", | |
radius = ".25rem", | |
color = "#383d41" , | |
background = "#e2e3e5", | |
padding = ".75rem 1.25rem"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
declare | |
cursor get_states_and_cities(pId_country number) is | |
select c.nm_country, | |
s.nm_state, | |
ct.nm_city | |
from countries c, | |
states s, | |
cities ct | |
where ct.id_state = s.id_state | |
and s.id_country = c.id_country |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const print_r = object => JSON.stringify(object, null, 2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<body> | |
<input type="file" name="picture" id="picture" /> | |
<pre></pre> | |
</body> | |
<script> | |
window.onload = function(){ | |
const getRequestHeaders = () => new Headers({ | |
'Accept': 'application/json' |
NewerOlder