tags:

views:

51

answers:

2

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 ajax and php in content div...

+3  A: 
$('select#load').change(function() {
  $.ajax({
    type: "GET",
    url: this.value,
    success: function(result) {
      $('#content').html(result);
    }
  });
})
Wim
It would be cleaner to move the event binding to the javascript file, `$('select#load').change(function() { ... })`
Tatu Ulmanen
Thanks, I updated my answer. Learning every day...
Wim
A: 

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

AntonioCS