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.
精彩评论