fork download
  1. <!DOCTYPE html>
  2. <html lang="ja">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>タイトル</title>
  6. <link rel="stylesheet" type="text/css" href="style.css">
  7. </head>
  8. <body>
  9.  
  10. <!-- アンテナ部分 -->
  11. <div style="border:1px solid red !important;height:300px;">
  12. <script src="https://c...content-available-to-author-only...y.com/jquery-3.5.1.js" integrity="sha256-QWo7LDvxbWT2tbbQ97B53yJnYU3WhH/C8ycbRAkjPDc=" crossorigin="anonymous"></script>
  13. <script type= "text/javascript">
  14.  
  15. $.ajax({
  16. //はてなrssファイルを読み込む
  17. //ブログのアドレスの最後にrssをつける
  18. url:'http://n...content-available-to-author-only...g.com/rss',
  19. success: function(data){
  20.  
  21. //はてなrssの読み込み
  22. var rss_url = 'http://n...content-available-to-author-only...g.com/rss';
  23.  
  24. var htmlstr = "";
  25. htmlstr += '<div class="recomend">';
  26. htmlstr += '<h2>関連記事</h2>';
  27. htmlstr += '<ul>';
  28.  
  29. //アイテムの調整
  30. $.get(rss_url, function(data) {
  31. $(data).find("item").each(function (i) {
  32. var el = $(this);
  33. var elimg = el.find("enclosure").attr("url");
  34.  
  35. htmlstr += '<li class="section">';
  36. htmlstr += '<p class="imgP"><img src="' + elimg + '" alt="" width="170" ></p>';
  37. htmlstr += '<a href="' + el.find("link").text() + '" title="' + el.find("title").text() + '" target="_blank">' + el.find("title").text() + ' - ' + el.find("category").text() + '</a>';
  38. htmlstr += '</li>';
  39.  
  40. if(i === 5) { // 表示件数の設定
  41. return false;
  42. };
  43. });
  44.  
  45. htmlstr += '</ul>';
  46. htmlstr += '</div>';
  47.  
  48. //footer前に挿入する
  49. $('footer').before(htmlstr);
  50. });
  51. }
  52. });
  53.  
  54. </script>
  55.  
  56. <ul id="feed"></ul>
  57. </div>
  58. <!-- アンテナ部分 -->
  59.  
  60.  
  61.  
  62. </body>
  63. </html>
Runtime error #stdin #stdout #stderr 0.32s 35596KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
js: "prog.js", line 18: syntax error
js:      url:'http://n...content-available-to-author-only...g.com/rss',
js: .........^
js: "prog.js", line 19: syntax error
js:      success: function(data){
js: .............^
js: "prog.js", line 51: syntax error
js:      }
js: .....^
js: "prog.js", line 52: syntax error
js: });
js: .^
js: "prog.js", line 54: illegally formed XML syntax
js: </script>
js: .^
js: "prog.js", line 54: syntax error
js: </script>
js: .^
js: "prog.js", line 56: missing ; before statement
js: <ul id="feed"></ul>
js: ......^
js: "prog.js", line 57: unterminated regular expression literal
js: </div>
js: .....^
js: "prog.js", line 62: unterminated regular expression literal
js: </body>
js: ......^
js: "prog.js", line 63: unterminated regular expression literal
js: </html>
js: ......^
js: "prog.js", line 1: Compilation produced 10 syntax errors.