.content {
width: 500px;
height: 300px;
border: 1px solid #ccc;
border-radius: 6px;
overflow: scroll;
}
歌曲
歌词
评论
详情
查看
$(function() {
$('.btn').click(function() {
var url = 'https://api.imjad.cn/cloudmusic/?type=lyric&id=28012022&br=128000';
var id = $('.song-id').val()
var type = $('input[type=radio]:checked').val()
$.ajax({
url: `https://api.imjad.cn/cloudmusic/`,
method: 'GET',
data: {
type: type,
id,
br: '128000'
},
success: function(data) {
var text = ''
if(type == 'lyric') {
text = data.tlyric.lyric
}else if(type == 'song'){
text = `下载地址:点击下载`
}else if(type == 'detail'){
text = `专辑名称:${data.songs[0].alia}
歌手:${data.songs[0].ar[0].name}
`
}
$('.content').html(text)
}
})
})
})
一键复制
编辑
Web IDE
原始数据
按行查看
历史