During online listening to songs a few days ago, I encountered the problem of obtaining the stream play address and LRC File Content Based on the song name. It took me a few hours to sort out the interface for everyone tonight, they are indispensable for online listening, because they use external jquery. js file, so please refresh the page again after running the code!
<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN "" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd "> <Html xmlns =" http://www.w3.org/1999/xhtml "> <HEAD> <TITLE> listening to songs </TITLE> <META http-equiv = Content-Type content =" text/html; charset = UTF-8 "> <script type =" text/javascript "src =" http://img.jb51.net/jslib/jquery/jquery-1.3.2.min.js?1.1.11 "> 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> to be selected:" + n + "</li>"; str = str + ss ;} else {if (n = "0") {alert ("sorry, no song found! "); $ (" # Surl "). attr ("disabled", false); return ;}}); str = str + "</ul>"; $ ("# searchsesult" pai.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 ("sorry, no lyrics found! "); $ (" # Slrc "). attr ("disabled", false); return ;}}});});});}); script </pead> <body> <p/> <p style = "clear: both; text-align: left; margin: 0; padding: 0; "> Search: <input type =" text "id =" kw "style =" width: 250px; "value =" country "/> <input type =" button "value =" Search song address "id =" surl "/> <input type =" button "value =" Search LRC lyrics "id =" slrc "/> <p id =" searchsesult "> </p> </body> </ptml>
[Ctrl + A select all Note: If you need to introduce external Js, You need to refresh it to execute]