jQuery mobile:对话框页面的有意义的URL? [英] jQuery mobile: Meaningful URL for a dialog page?

查看:83
本文介绍了jQuery mobile:对话框页面的有意义的URL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以链接到对话框并将其显示为对话框?

Is it possible to link to a dialog, and have it display as a dialog?

换句话说:

  1. 从基础页面打开对话框
  2. 在URL上添加书签
  3. 打开新的浏览器标签
  4. 粘贴网址
  5. 使对话框在其基础页面前打开

我看不到如何链接到此处)-如果我复制URL并重新打开它们,则会打开基础页面,但不会打开对话框.

I can't see how to link to the dialogs in the jQuery Mobile demo (or here) - if I copy the URLs, and reopen them, the underlying page opens but not the dialog.

推荐答案

您所要做的就是在链接上指定应打开目标作为对话框.

All you have to do is specify on your link that it should open the target as a dialog.

在您发布的文档页面上的示例中,对话框打开链接写为:

In the example on that documentation page you posted, the dialog-opening link is written as:

<a href="foo.html" data-rel="dialog">Open dialog</a>

如果遇到问题,建议您正确设置页面(无论是否通过Ajax提取页面).

If you are having problems, I'd suggest ensuring that your pages are setup properly (whether you are fetching them by Ajax or not).

编辑

比方说您的基础页面是:www.example.com.对话框页面的内容存储在www.example.com/dialog.html中.如果您想将对话链接发送给某人,我会这样做:

Let's say your base page is: www.example.com. The dialog page content is stored at www.example.com/dialog.html. If you wanted to send a dialoged link to someone, I would do it like this:

在基本URL的末尾添加一个主题标签:www.example.com/#dialog=dialog%3Fhtml.然后,该页面将查看其URL末尾是否有任何#dialog=.如果是这样,以编程方式打开对话框.如果您想要一些示例代码,请随时询问.

Add a hashtag to the end of the base url: www.example.com/#dialog=dialog%3Fhtml. The page would then look to see if it has any #dialog= at the end of its URL. If it does, programatically open the dialog. If you'd like some example code, feel free to ask.

这篇关于jQuery mobile:对话框页面的有意义的URL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆