scrapyで削った.jsonの部分だけを表示したいとします。 scrapy出力は次のようになりますし、約500のエントリがあります。私は何をしたいかjsonデータでselect要素を設定し、jsonのフィルタ処理されたコンテンツを返す
data.json
[
{
"Content":["<h2>Heading of Paragraph1</h2><p>the actual pargraph1</p>"],
"Titel": ["Heading of Paragraph1"]
}
,
{
"Content": ["<h2>Heading of Paragraph2</h2><p>the actual pargraph2</p>"],
"Titel": ["Heading of Paragraph2"]
}
,
{
"Content": ["<h2>Heading of Paragraph3</h2><p>the actual pargraph3</p>"],
"Titel": ["Heading of Paragraph3"]
}
]
は、選択するユーザーのためのすべて「TITEL」要素のリストを生成することですから。次に、ウェブサイトは選択された段落を表示する必要があります。 私はいくつかのjavascriptがおそらく行く方法であることを理解しました。 UIを使用可能にするには、後でchosenを使用する予定です。
は、これまでのところ、私は私の問題ではJavaScriptでこのHTML
index.htmlを
<body>
<form action="/returnselected_paragraphs.js">
<select name="pargraphs" multiple>
<option value="Heading of Pargraph1">Heading of Paragraph1</option>
<option value="Heading of Pargraph2">Heading of Paragraph2</option>
<option value="Heading of Pargraph3">Heading of Paragraph3</option>
<!-- this should be genereated by javascript with data from the json --!>
<input type="submit">
</form>
<h1>output</h1>
<h2>Heading of Paragraph1</h2><p>the actual pargraph1</p>
<h2>Heading of Paragraph2</h2><p>the actual pargraph2</p>
<!-- this should be genereated by javascript with data from json--!>
を思い付きました。 私はthis code on jsfiddleが欲しいものと似ていると感じましたが、データの形式が異なっています。私はそれを自分のデータにどのように適応させるかわかりません。
私はここに私の考えを置く:https://jsfiddle.net/jtxzerpu/
は、私はすべてのルールに固執なかった願って、お時間ありがとうございました。
ありがとう!ここではサイト上で動作しますが、フリーリストボックスをreturnselected_paragraphs.jsとして保存し、2番目のリストを同じディレクトリにindex.htmlとして保存すると、何もしません。 – Nivatius
説明した問題と新しい問題を関連付けることができませんあなたのオリジナルの質問に彼らがどのように関係しているのか理解できますか? – gurvinder372
私はちょうどJavaScriptを読み込む際に問題がありました。 – Nivatius