jquery ui dialog load separate page without iframe

 

Load the page with an iframe,

Advantages, no conflicts, disadvantages: need to refer to css, js separately

 

1. Use ifame

method one:

I feel this is better, you don't have to always recreate the iframe

<div style="display:none;overflow:hidden;padding:3px" id="dialog"><iframe frameborder="no" border="0" marginwidth="0" marginheight="0" id="prodcutDetailSrc"  scrolling="no"  width="100%" height="100%"></iframe></div>

 

$("#prodcutDetailSrc").attr("src","ProductDetails.aspx?id=" + $(this).attr("id")); //设置IFRAME的SRC;
$("#dialog").dialog({dialogoptions});

 https://www.cnblogs.com/kmsfan/p/4119788.html

 

Method two:

$("<iframe id='editFrame' src='http://localhost:8080/upf/test.jsp' />").dialog({autoOpen: true, modal: true, title: "新增人员" });

 https://blog.csdn.net/codefighting/article/details/6263776

 

2. Do not use ifame

Load with the load method, recommended

<div id="dlgCheckRole" class="hide"></div>

 

$("#dlgCheckRole").load(contextPath+"/role/checkRole?userId="+userId).removeClass('hide').dialog({dialogoptions});

 https://stackoverflow.com/questions/5660263/how-to-display-an-iframe-inside-a-jquery-ui-dialog

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326110012&siteId=291194637