我正在使用PHP Simple HTML DOM Parser
將網站保存爲htm
文件。然後我使用jQuery從文件中提取div
並將其放入div
。我想要創建一個 上一個和下一個按鈕,但我遇到的問題是要做到這一點,我必須更改URL以便解析器可以獲取頁面。如果你能提供幫助,我將不勝感激。以下是我正在使用的代碼。使用jquery的Next和Previous按鈕
<?php
include('site/simple_html_dom.php');
$html=file_get_html('http://roosterteeth.com/home.php?page=1');
$html->save('site/rtnews.htm')
?>
<script type="text/javascript" src="site/jquery.js"></script>
<script type="text/javascript">
$('document').ready(function() {
$('#wrap').click(function (event){
event.preventDefault();
});
$("#wrap").load('site/rtnews.htm #postsArea');
});
</script>
</head>
<body>
<div id="wrap">
</div>
</body>
Next&Previous按鈕用於何種用途? –
我從'htm'文件中提取帖子。所以我將使用Next&Previous按鈕來更改解析器使用的頁面'URL'。所以如果我按next,它會將'URl'改爲http://roosterteeth.com/home.php?page=2。 – Sabre