开发者

I would like to fill a jqmodal with data coming from a jquery post()

开发者 https://www.devze.com 2023-04-09 23:58 出处:网络
I have this code which is functional: jQuery(\"#Zone__\" + row + \"__documents\").find(\"td:eq(3)\").mouseover(function(){

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");
         }
    });  
});
0

精彩评论

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

关注公众号