Hi everybody, Now we are going to learn about implementation of ajax based responsive mega menu because a lot of people’s struct to create ajax based mega menu with Twitter bootstrap. This type of menu quitly useful for e-commerce and news/magazines based websites to display contents very fast . Exp: mahsable.com. So we are going to implement mahsable like responsive ajax based drop down menu.
In this php file we will get the post from posts table and sent it as JSON response to the request. Here i have added query to get post by category. I have used PDO to intract with MySQL database because it overcomes the SQL injection.
$posts=$con->prepare("SELECT title, url, image from posts where category_id = ? LIMIT 4");
$post_list.='<div class="col-xs-6 col-md-3">
<a href="'.$post['url'].'" class="thumbnail">
<img src="'.$post['image'].'" />
Also i have given live demo and download option. Don’t forgot to share and subscribe for my latest updates..