Home >Web Front-end >JS Tutorial >javascript Get the playback address and lyrics content based on the song title_javascript skills

javascript Get the playback address and lyrics content based on the song title_javascript skills

WBOY
WBOYOriginal
2016-05-16 18:52:011826browse

Let me tell you, when you listen to music online, you cannot do without them. Since the external jquery.js file is used, please refresh the page after running the code to take effect!


[Ctrl A select all Note:
If you need to introduce external Js, you need to refresh to execute ]<script> $(function(){ $("#surl").bind("click",function(){ $("#surl").attr("disabled",true); var song = encodeURI($("#kw").val()); song = encodeURI(song); var str = "<ul>"; $.getJSON("http://www.faqee.com/crm/song?act=songurl&song="+song+"&jsoncallback=?", function(json){ $.each(json,function(i,n){ n = n+""; i = i+""; if(i!="res"){ var ss = "<li>待选:<a href=\"#\">"+n+""; str=str+ss; }else{ if(n == "0"){ alert("抱歉,搜索不到歌曲!"); $("#surl").attr("disabled",false); return; } } }); str = str+""; $("#searchsesult").html(str); $("#surl").attr("disabled",false); }); }); $("#slrc").bind("click",function(){ $("#slrc").attr("disabled",true); var song = encodeURI($("#kw").val()); song = encodeURI(song); var str = ""; $.getJSON("http://www.faqee.com/crm/song?act=songlrc&song="+song+"&jsoncallback=?", function(json){ $.each(json,function(i,n){ n = n+""; i = i+""; if(i!="res"){ $("#searchsesult").html(n); $("#slrc").attr("disabled",false); return; }else{ if(n == "0"){ alert("抱歉,搜索不到歌词!"); $("#slrc").attr("disabled",false); return; } } }); }); }); }); </script>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn