Kumar Kumar - 1 year ago 75
jQuery Question

Replace the current content of div with another page response

Sample code:

<div id="content">
<input type="submit" onclick="loadAnotherPage()"/>

I want to load another page say edit_profile.php in the
div. How can it be achieved without refreshing the page?

I tried to use jQuery
method. But looks like I missed something. Any help would be highly appreciated.

Answer Source

When you click submit button it's submit form and page refresh that's why its not working.

Instead of type submit set button and then set function onclick.

function loadAnotherPage(){
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download