简体   繁体   English

如何在JQuery对话框中打开.cfm页面?

[英]How to open .cfm page in JQuery dialog box?

I have a link on my page where user can click and open another page. 我的页面上有一个链接,用户可以单击并打开另一个页面。 My current code open this page in another tab. 我当前的代码在另一个标签中打开此页面。 So I would like that to be done in JQuery dialog box. 因此,我希望在“ JQuery”对话框中完成此操作。 User can click on the link and open the page without opening a new window. 用户可以单击链接并打开页面,而无需打开新窗口。 I already placed my div on the bottom of my current page and set the id to dialog. 我已经将div放置在当前页面的底部,并将id设置为dialog。 Here is my code: 这是我的代码:

<div>
    <a class="nav" href="procedure.cfm" target="_blank" style="color:red" onClick="verifyProcedure()">Procedure for use</a>
</div>

function verifyProcedure() {
    document.getElementById("submitForm").disabled = false;
    var contentUrl = 'procedure.cfm' 
    var dialog1 = $("<div>").dialog({
      autoOpen: false,
      modal: true,
      close: function (e, ui) { $(this).remove(); },
      buttons: { "Ok": function () { $(this).dialog("close"); } }
    });
    dialog1.load(contentUrl).dialog('open');
}

Code above doesn't work the way I want to. 上面的代码无法按我想要的方式工作。 My page still gets open in new tab. 我的页面仍在新标签页中打开。 I want dialog box to pop up on the same page with content of my procedure.cfm page. 我希望对话框与我的procedure.cfm页面的内容一起在同一页面上弹出。 Can anyone help me how to get this to work? 谁能帮我如何使它正常工作? Thanks in advance. 提前致谢。

从链接中删除href和目标

<a class="nav" href="javascript:void(0)" style="color:red" onClick="verifyProcedure()">Procedure for use</a>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM