I have a requirement where i need to show the list of data in a jquery dialog once a some link is clicked .I can easily collect the data that has to be shown in the dialog on page load and display the data in开发者_开发知识库 the dialog.I will place those data in a hidden div and simply pop it up when the user clicks on the link.But my requirement is that there has to be jquery ajax get when the users clicks on the link and that content should be displayed in the jquery dialog.How can i achieve that.
Thanks In Advance,
Tech Used:Asp.net mvc,Jquery
When the link is clicked, populate a div (in the below example a div which already exists) using an ajax method such as .load
and initialize a dialog on the newly populated div (untested!):
$("#theLink").click(function() {
$("#myDiv").load("/some/link.html")
.dialog({ autoOpen: false });
$("#myDiv").dialog('open');
});
http://api.jquery.com/load/
精彩评论