I’m new to jQuery, I used this code but it does not work:
<script type="text/javascript" src="jquery.js" ></script>
<script>
$(document).ready(function(){
$("#add_cl").click(function(){
$("#formtag").load("main.php");
});
});
</script>
On clicking the button having id="add_cl" want to load main.php in #formtag like ajax. On clicking it, it shows main.php page in live view in Dreamweaver but not in Chrome and Firefox.
localhosttry with:127.0.0.1Related to your comment:
to load different pages inside the same element try using the
dataattribute to store your URLs:additionally you could try also
.empty()to remove old content from your#formtag:$("#formtag").empty().load( $(this).data('loadpage') );