jquery Dialog:如何将参数传递到在对话框中打开的页面
我正在使用 jquery 对话框打开一个 aspx 页面,其中有一个用于发送电子邮件的表单。我需要将调用页面的标题和 url 传递给对话框,以便在电子邮件中发送。以前,我将电子邮件表单放在调用页面上的 div 内,单击锚点后,div 将显示在对话框中,用户可以从对话框中发送电子邮件。但是,现在我将电子邮件表单移至一个单独的 aspx 页面,该页面在打开的对话框中调用,例如
$(document).ready(function () {
var dlg = $("#dialog").dialog({
autoOpen: false,
modal: true,
draggable: true,
resizable: true,
width: 550,
title: 'Send Email',
minHeight: 10,
minwidth: 10,
closeText: 'X',
closeOnEscape: true
});
var pgTitle = $(document)[0].title;
var pgURL = window.location.pathname;
$("#dialog_link").click(function () {
var urlLink = "Email.aspx"; //?title=" + pgTitle + "&url=" + pgURL;
// $("#dialog").dialog("open");
dlg.load(urlLink).dialog('open', function () {
$(this).dialog('open');
});
});
});
如果我在 urlLink 中附加 url 和标题值,则 Email.aspx 页面为 我删除它们时,我该如何将这些参数传递给 Email.aspx?
未显示在对话框中。当
I am using jquery dialog to open an aspx page, which has a form for sending email. I need to pass the title and url of the calling page to the dialog so that it is sent in the email. Previosuly, I had the email form inside a div on the calling page and on the click of an anchor the div was displayed in the dialog and a user could send out an email from the dialog. However, now i moved the email form to a separate aspx page which is called on the open dialog e.g
$(document).ready(function () {
var dlg = $("#dialog").dialog({
autoOpen: false,
modal: true,
draggable: true,
resizable: true,
width: 550,
title: 'Send Email',
minHeight: 10,
minwidth: 10,
closeText: 'X',
closeOnEscape: true
});
var pgTitle = $(document)[0].title;
var pgURL = window.location.pathname;
$("#dialog_link").click(function () {
var urlLink = "Email.aspx"; //?title=" + pgTitle + "&url=" + pgURL;
// $("#dialog").dialog("open");
dlg.load(urlLink).dialog('open', function () {
$(this).dialog('open');
});
});
});
If I append the url and title values in the urlLink, the Email.aspx page is not displayed in dialog. When I remove them then the page is displayed. How am i supposed to pass these parameters to Email.aspx?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果iframe src是https:,我使用url中的参数并使用javascript来解析。
如果 iframe src 不是 https,我会使用变量并使用 javascript 中的 window.parent 从 iframe 页面访问它们。
If the iframe src is https:, I use parameters in the url and use javascript to parse.
If the iframe src is not https, I use variables and access them from the iframe page using window.parent in the javascript.