开发者

reloading page content with <select> php ajax

here is my code...

<select id="load">
<option value="page1.php"></option>
<option value="page2.php"></option>
<option value="page3.php"></option>
</select>
<div id="content"</div>

i want to load these page1.php, page2.php and page3.php via jquery aj开发者_JAVA百科ax and php in content div...


$('select#load').change(function() {
  $.ajax({
    type: "GET",
    url: this.value,
    success: function(result) {
      $('#content').html(result);
    }
  });
})


If you don't want to use jQuery or Ajax you can use an iframe and just change the src attribute.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜