JSON

  • c6_967428
    了解作者
  • 1.7KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-09 10:14
    上传日期
JSON
JSON-main.zip
  • JSON-main
  • JSONassignment.html
    2.7KB
  • setList.json
    1.3KB
内容介绍
<!doctype html> <html> <head> <meta charset="utf-8"> <title>JSON Setlist</title> <script src="https://code.jquery.com/jquery-3.1.1.min.js" integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8=" crossorigin="anonymous"></script> </head> <body> <div id="rawStr"> &nbsp; <div> <select name="sort" id="sort"> <option>Filter by genre</option> <option value="Pop">Pop</option> <option value="Folk">Folk</option> <option value="Hip-Hop">Hip-Hop</option> <option value="Rap">Rap</option> <option value="Disco">Disco</option> <option value="Indie">Indie</option> <option value="Alternative">Alternative</option> </select><br /> <input type="button" value="Filter" onclick="whenClicked()"> <div id="songList"> &nbsp; <div> <script language="javascript"> $.get("https://cmacke01.github.io/JSON/setList.json", function( data ) { setList = JSON.stringify(data); // document.getElementById("rawStr").innerHTML= setList + "<br>"; strSetList = "<br>"; data.forEach(function(song) { strSetList += "<br> <strong>" + song.title + "</strong> <br>" + "Artist(s): " + song.artists[0]; for (i = 1; i < song.artists.length; i++){ strSetList += ", &nbsp;" + song.artists[i]; } strSetList += "<br> Genre(s): " + song.genres[0]; for (i = 1; i < song.genres.length; i++){ strSetList += ", &nbsp;" + song.genres[i]; } strSetList += "<br> Released: " + song.releaseYear + "<br>"; }) document.getElementById("songList").innerHTML = strSetList + "<br>"; }) function whenClicked() { option = $("select").find("option:selected").val(); $.get("https://cmacke01.github.io/JSON/setList.json", function( data ) { setList = JSON.stringify(data); // document.getElementById("rawStr").innerHTML= setList + "<br>"; strSetList = "<br>"; data.forEach(function(song) { for (i = 0; i < song.genres.length; i++){ if (option == song.genres[i]){ strSetList += "<br> <strong>" + song.title + "</strong> <br>" + "Artist(s): " + song.artists[0]; for (i = 1; i < song.artists.length; i++){ strSetList += ", &nbsp;" + song.artists[i]; } strSetList += "<br> Genre(s): " + song.genres[0]; for (i = 1; i < song.genres.length; i++){ strSetList += ", &nbsp;" + song.genres[i]; } strSetList += "<br> Released: " + song.releaseYear + "<br>"; } } }) document.getElementById("songList").innerHTML = strSetList + "<br>"; }) } </script> </body> </html>
评论
    相关推荐
    • json
      json
    • json
      json
    • json
      json
    • json
      json
    • json
      json Json用于检索商店中的物品以及授权和注册
    • json
      json
    • json
      json
    • JSON viewer
      JSON Viewer是一款方便易用的Json格式查看器。Json格式的数据阅读性很差,如果数据量大的话再阅读方面会十分困难,有了这软件,问题就解决了,能够快速把Json字符串排列规则的树结构,支持对JSON字符串进行格式化...
    • Json
      Json
    • GaussDB_100_1.0.1-DATABASE-REDHAT-64bit.tar.gz
      guassdb100在redhat上安装包,单机部署的包,安装步骤请看我的文中介绍,经过大量实验搭建总结出来的文档