开发者

jquery ajax call make fillthe jquery dialog

开发者 https://www.devze.com 2023-01-11 15:29 出处:网络
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 datathat has to be shown in the dialog on page load and display the

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/

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号