when i run this it only shows me the loader and does not get the ip. i did different modification but nothing seems working... and also i am very new to javascript.
const getIp = document.getElementById('ipTrigger');
getIp.addEventListener('click', function(){
swal.fire({
title: 'Your public IP',
confirmButtonText: 'Show my public IP',
showCloseButton: true,
text:
'Your public IP will be received ' +
'via AJAX request',
showLoaderOnConfirm: true,
preConfirm: function () {
return new Promise(function (resolve) {
$.get('https://api.ipify.org?format=json')
.done(function (data) {
swal.insertQueueStep(data.ip)
resolve()
})
})
}
});
});