• We just launched and are currently in beta. Join us as we build and grow the community.

Simple JavaScript Problem (HELP)

Gdirty1

Crypto Asset Appraiser
G Rep
0
0
0
Rep
0
G Vouches
0
0
0
Vouches
0
Posts
143
Likes
11
Bits
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?
 

422,212

310,551

310,560

Top