I have a page with a div
tag like this
<div class="ajax-load">
<!-- First.php: jquery-slider-1
jquery-widget-1
second.php: jquery-slider-2
jquery-widget-2
-->
</div>
And a button
like this
<button class="go-to-page-2">
When I click the button with class go-to-page2
I need to load some php pages say four.php and five.php
into or inside the div with class ajax-load.
Using plain markup
, I can easily place it like this
<?php
require_once("four.php");
require_once("five.php");
?>
But I do not want this. I want to load contents into the div using ajax.
I tried this:
$(".ajax-load").load("4.php")
But cant load or append 5.php using this. How to overcome this? I am ready to use $.get and $.post