Skip to main content
チームを作成
APIを追加
ドキュメント
サインイン
サインアップ
チームを作成
APIを追加
ドキュメント
サインイン
サインアップ
Red Giant / andhoule15
Quotes and Biography
The most comprehensive Quotes and Biography API that you can find to create great apps accordingly.
議論
1
All
Questions
Answers
Title
Created at
(Click to sort ascending)
A
3
You can solve this problem by using ajax request as follow >>>> function getImg (){ var data = null; var xhr = new XMLHttpRequest(); xhr.withCredentials = true; xhr.responseType = 'arraybuffer'; xhr.onload = function (e) { if (this.readyState === this.DONE) { var uInt8Array = new Uint8Array(this.response); var i = uInt8Array.length; var binaryString = new Array(i); while (i--) { binaryString[i] = String.fromCharCode(uInt8Array[i]); } var data = binaryString.join(''); var base64 = window.btoa(data); var src ="data:image/png;base64," + base64; /* do something like : */ $('img').attr('src', src); console.log(src); } }; xhr.open("GET", "https://coronavirus-monitor.p.rapidapi.com/coronavirus/masks.php", true); xhr.setRequestHeader("x-rapidapi-host", "coronavirus-monitor.p.rapidapi.com"); xhr.setRequestHeader("x-rapidapi-key", "xxxxxxxxxxxx your API"); xhr.send(data); } getImg(); /* good luke ;)*/
Mon 6:30
23/3/20