In my button click i had a popup div and inside that i need to show divs with data return in json format
<a href='somelink' title='hello'class='details' rel='id'>h1</a>
My pop up div as follows
<div id="popupdiv">
</div>
<script type="text/javascript">
$(".details").live("click", function () {
var id = $(this).attr("rel");
$('#popupdiv').modal();
$.ajax({
type: "GET",
contentType: "application/json; charset=utf-8",
url: "/mycontroller/details?Id="+ id,
data: "",
dataType: "json",
success: function (data) { //which contains name,email etc how can i append the details on to the "popupdiv" div by inserting in to another div
}
});
return false;
});
</script>
Just append the returned data to the div you are using as a modal. Here is an example for “name”:
If you want a div within #popupdiv, use
http://jqapi.com/#p=append
Note that I’ve taken a guess at what your JSON is like.