JQueryMobile:简单的 url 加载后无法正确呈现

发布于 2024-10-07 00:50:30 字数 200 浏览 0 评论 0原文

情况:得到一个链接列表,应该加载另一个列表(位于同一服务器)。

问题:单击链接后,内容将呈现为纯 html。

演示:http://covraag.nl/derma/index.html

问题:我在做什么错误的?

Situation: got a list of links which should load another list (located at the same server).

Problem: After clicking a link the content is being rendered as plain html.

Demo: http://covraag.nl/derma/index.html

Question: What am I doing wrong?

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

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

发布评论

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

评论(1

梦罢 2024-10-14 00:50:30

我不会直接回答您的问题,因为示例不可用,但这里有一些很容易犯的错误:

  • 错误的 doctype 或没有 doctype
  • 无效的 html
  • 根本没有包装 HTML - jquery 使用 ajax 加载它,但需要一个 正确的页面
  • 数据角色中
  • 拼写错误页面上重复的 ID
  • 缺少数据角色

[编辑]

乍一看一切看起来都不错。你唯一做错的就是在 [letter].html 的头部添加内容 - 当通过链接获取网站时,这会被忽略。尝试使所有 html 文件的 head 部分看起来都相同。但我不认为这就是它不起作用的原因。我只是提出来,因为以后会产生问题。

你的问题全在脑子里[我听起来像尤达吗? ;)]
1.您的索引链接的是 jqm 1.0a1 而不是 a2
2. jqm 和 jquery 1.4.4 存在一些问题,会导致您出现这种问题。切换到 jquery 1.4.3 - 我测试过,然后就可以了

I won't post a direct answer to your problem as the example is unavaliable, but here are some mistakes that could be easily made:

  • bad doctype or no doctype
  • invalid html
  • no wrapping HTML at all - jquery loads it with ajax, but expects a proper page
  • typo in data-roles
  • duplicated IDs on page
  • missing data-role

[edit]

Everything looks ok at first glance. Only thing you do wrong is adding stuff in the head of the [letter].html - this is ignored when the site is fetched by the link. Try making the head section look the same in all html files. But I don't think this is why it doesn't work. I just bring it up, because it will create problems later.

Your problem is all in the head [Do I sound like Yoda? ;)]
1. your index has jqm 1.0a1 instead of a2 linked
2. there are some issues with jqm and jquery 1.4.4 that cause your kind of problems. Switch to jquery 1.4.3 - I tested, it works then

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