I would like to fill a jqmodal with data coming from a jquery post()
I have this code which is functional:
jQuery("#Zone__" + row + "__documents").find("td:eq(3)").mouseover(function(){
var text = jQuery("#Zone__" + row + "__documents").find("td:eq(3)").html();
if(text.indexOf("...")开发者_如何学C > 0){
jQuery.post("/_common/cfc/act_get.cfc?method=getNcas&returnFormat=json",
{document_id:doc_id,maxnum:100},
function(res,code){
alert(res);
},
"json"
);
}
});
Now, instead of an alert, I would like to open the jquery plugin 'jqmodal' with the data coming from the post inside it (res). Could someone help me to achieve this ?
Thank you in advance, Michel
Not familiar with that plugin but by a quick read of the documentation I would expect this to work (assuming you have included the required .js/.css resources:
<div class="jqmWindow" id="dialog"></div>
$(document).ready(function() {
$('#dialog').jqm();
jQuery("#Zone__" + row + "__documents").find("td:eq(3)").mouseover(function(){
var text = jQuery("#Zone__" + row + "__documents").find("td:eq(3)").html();
if(text.indexOf("...") > 0){
jQuery.post("/_common/cfc/act_get.cfc?method=getNcas&returnFormat=json",
{document_id:doc_id,maxnum:100},
function(res,code){
$('#dialog').html(res);
$('#dialog').jqmShow();
},
"json");
}
});
});
精彩评论