Gdirty1
Crypto Asset Appraiser
2
MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1
400 XP
As title i have a simple problem i am not good at js
document.querySelector("#button1").addEventListener("click",getApi);
const o1 = document.querySelector('#CleanResult');
const o2 = document.querySelector('#WebsiteThreatType');
const o3 = document.querySelector('#FoundViruses');
async function getApi(){
const t = await fetch('https://api.cloudmersive.com/virus/scan/website' , {
method: 'POST' ,
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'apikey': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
},
body: 'url=https://google.com'
});
const data = await t.json();
o1.innerHTML = ' Is Clean? : ' + data.CleanResult
o2.innerHTML = ' Virus Type : ' + data.WebsiteThreatType
o3.innerHTML = ' Founded Viruses : ' + data.FoundViruses
console.log(data)
}
its my code and the output is
How can i change the "true" to "YES" and "none" to "something else"
using if statement?
document.querySelector("#button1").addEventListener("click",getApi);
const o1 = document.querySelector('#CleanResult');
const o2 = document.querySelector('#WebsiteThreatType');
const o3 = document.querySelector('#FoundViruses');
async function getApi(){
const t = await fetch('https://api.cloudmersive.com/virus/scan/website' , {
method: 'POST' ,
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'apikey': 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
},
body: 'url=https://google.com'
});
const data = await t.json();
o1.innerHTML = ' Is Clean? : ' + data.CleanResult
o2.innerHTML = ' Virus Type : ' + data.WebsiteThreatType
o3.innerHTML = ' Founded Viruses : ' + data.FoundViruses
console.log(data)
}
its my code and the output is
How can i change the "true" to "YES" and "none" to "something else"
using if statement?