Got request from wife how to display detail in modal box with dynamic content grab in database. So i wrote piece of code to guide her. This tutorial is on PHP


<div id="dialog" title="Default">
    <div id="dinamicDiv"></div>
<button data-value="1" id="opener">Open Dialog</button>


$( function() {
		  //Initialize dialog
			autoOpen: false,
			show: {
				effect: "blind",
				duration: 1000
			hide: {
				effect: "explode",
				duration: 1000

		//Open it when #opener is clicked
		$("#opener").click(function () {
		var id=$("#opener").data("value");
		  method: "GET",
		  url: "some.php",
		  data: { id: id}
		  .done(function( data ) {
				$("#dinamicDiv").html("error occured");
  } );

some.php file

hiii semua<br/>

sample working project

Dynamic Modal Box Content With Ajax Request
Tagged on:         

Leave a Reply

Your email address will not be published. Required fields are marked *