使用 jquery 在模型弹出窗口中打开新页面

发布于 2024-12-02 18:34:45 字数 72 浏览 1 评论 0原文

任何人都知道如何使用 jQuery 在模型弹出窗口中打开新页面。 新页面应该是 Aspx 页面。 我不想使用 ajax 扩展器。

Any one have idea how to open a new page in model popup using jQuery.
New page should be Aspx page.
I do not want use ajax extender.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

段念尘 2024-12-09 18:34:45

您可以使用 jQuery UI 对话框

$('#dialog').load('/path/to/aspx', function() {
    $(this).dialog({
        modal: true,
        height: 200
    });
});

这将加载位于/path/to/的页面aspx 放在一个带有 id dialog 的 div 中,然后在模态窗口中呈现该 div 的内容。

在 html 中包含以下内容

<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>

有关详细信息,请参阅链接文档

You could use a jQuery UI Dialog.

$('#dialog').load('/path/to/aspx', function() {
    $(this).dialog({
        modal: true,
        height: 200
    });
});

This will load the page at /path/to/aspx in a div with id dialog and then present the contents of the div in a modal window.

Include the following in your html

<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>

See the linked documentation for more information.

谜兔 2024-12-09 18:34:45

您可以使用 Facebox 插件代替 jQuery UI 对话框。
这是一个非常酷的插件并且易于使用。这里有一个简单的分步说明:

  1. 将所有必需的链接放入网页的头部,其网页上有说明。
  2. 您必须在网页上的某个位置添加这段代码,最好是在头部:

    jQuery(文档).ready(函数($) {
        $('a[rel*=facebox]').facebox() 
    })
    
  3. 如果您这样做了,您可以像这样插入 HTML 链接:

    链接标题
    

我希望对您有所帮助。

Instead of jQuery UI Dialog, you could use the Facebox Plugin.
It's a very cool plugin and easy to use. Here a simple step by step instruction:

  1. Put all the required links into the head part of your webpage, it's explained on their webpage.
  2. Than you'll have to add this piece of code somewhere on your Webpage, best in the head:

    jQuery(document).ready(function($) {
        $('a[rel*=facebox]').facebox() 
    })
    
  3. If you did this, you can just insert HTML links like this:

    <a href="somepage.aspx" rel="facebox">Link Title</a>
    

I hope that helps you.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文