function http(url){
return new Promise((resolve,reject)=>{
$.ajax({
url,
success:res=>{
resolve(res)
},
error:err=>{
reject(err);
}
})
})
}
<script src="lib/jquery-3.6.0.min.js"></script>
<script src="promise/http.js"></script>
</head>
<body>
<script>
var url = `http://47.108.197.28:3000/top/playlist`
http(url).then(res=>{
console.log(res)
})
</script>
</body>