0
我在index.html
,我ajax query.php
並得到結果。現在如何在將block.html
加載到content
之前填充block.html
,以便在沒有顏色/大小信息的情況下不會顯示文本?如何在顯示之前填充加載的內容?
的index.html
<div id="content"><button id="button1" type="button">click</button></div>
block.html
You selected the color: <div id="color"></div>!
You chose a size of: <div id="size"></div>!
query.php
$result = array('color' => 'blue', 'size' => '12');
echo json_encode($result);
爲什麼block.html自己的文件? –
有多個步驟,當你點擊一個按鈕,它會加載block.html到內容中,當你點擊另一個它會加載block2.html。 – Roger