0

I am testing iUI for mobile web apps. Instead of putting all content into a single HTML page, I am using the Ajax hyperlink technique described by Joe Hewitt here. However I cannot get this to work in Chrome, although Joe Hewitt's own Digg demo, which uses the same technique, seems to work correctly.

Here is the simplified source code:

main.html:

<!DOCTYPE html>
<html>
<head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
   <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"/>
   <link rel="stylesheet" href="iui/iui.css" type="text/css" />
   <link rel="stylesheet" href="iui/t/default/default-theme.css" type="text/css"/>
   <script type="application/x-javascript" src="iui/iui.js"></script>
</head>

<body>
   <div class="toolbar">
      <h1 id="pageTitle"></h1>
      <a id="backButton" class="button" href="#"></a>
   </div>

   <ul id="main" title="Main" selected="true">
      <li><a href="screen1.html">Go to Screen #1</a></li>
      <li><a href="screen2.html">Go to Screen #2</a></li>
   </ul>
</body>
</html>

screen1.html:

<div class="panel" title="Screen 1">
<ul><li>Hello 1</li></ul>
</div>

screen2.html:

<div title="Screen 2">
Hello 2
</div>

This works fine on Firefox (minus styling issue in screen2.html) but the links do not work on Chrome.

Any pointers?

4

2 回答 2

1

使用的基于 AJAX 的导航可能需要在 Web 服务器上查看才能在某些浏览器中工作。如果您在单击链接时看到错误消息,请尝试使用其他浏览器。当我使用 jQuery Mobile 时,有时 Ajax 超链接技术有效,有时则无效。尽管相同的代码在 Opera 上运行良好。

于 2012-02-14T08:59:20.760 回答
0

看起来与 iUI 没有任何关系,而是影响通过 Ajax 加载任何本地文件的 Chrome 问题。

这是与此问题相关的另一个 SO 问题,这次出现在 JQuery 中:

接受的答案包括指向 Chromium 错误跟踪器中的错误的链接。

于 2011-09-30T11:01:49.337 回答