我正在开发一个小型WebApp for iPad,以便向SSRS用户呈现报告。我知道现在有像MobiWave这样的解决方案,但我的客户要求我开发一种更适合他的环境的解决方案。iPad上的Webapp在一个新的Safari浏览器标签中打开iFrame的链接
所以我的问题是以下。我将SSRS的内容加载到iFrame中并呈现给用户。现在,当我点击链接时,行为如下。在Chrome中,Safari移动版(在iPad上)网站按预期工作。当我运行与web应用程序相同的站点时,链接将在新的Safari浏览器窗口中打开。我尝试了许多解决方案,如this和this,但我没有按预期工作。
我的代码如下:
<!DOCTYPE html>
<html>
<head>
<title> TEST </title>
<link rel="stylesheet" href="css/jquery.mobile-1.1.1.min.css" />
<link rel="stylesheet" href="css/style.css" />
<script src="js/jquery-1.7.1.min.js"></script>
<script src="js/jquery.mobile-1.1.1.min.js"></script>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=yes">
<link rel="apple-touch-icon" sizes="72x72" href="images/touch-icon-ipad.png" />
<link rel="apple-touch-startup-image" href="images/startup.png">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
</head>
<body>
<div data-role="page" id="home">
<div data-role="header">
<ul data-role="controlgroup" data-type="horizontal" class="localnav">
<li><a data-role="button" data-rel="back" data-icon="arrow-l">Back</a></li>
<li><a href="./" data-role="button" data-icon="home" data-ajax="false">Home</a></li>
</ul>
</div>
<div id="content" data-role="content">
<iframe src="../ReportServer"></iframe>
</div>
</div>
</body>
</html>
编辑
其加载到iFrame中的代码如下:
<html>
<head>
<meta name="Generator" content="Microsoft SQL Server Reporting Services, Version 10.50.1600.1">
<title>localhost/ReportServer - /Reportings</title>
</head>
<body><H1>localhost/ReportServer - /Reportings</H1><hr>
<pre>
<A HREF="http://localhost/ReportServer?&rs%3ACommand=ListChildren">[In übergeordnetes Verzeichnis]</A>
Donnerstag, 13. September 2012 15:16 39033 <A HREF="?%2fReportings%2fReport1&rs:Command=Render">Report1</A>
</pre>
<hr>
Microsoft SQL Server Reporting Services, Version 10.50.1600.1
</body>
</html>
感谢快速回答。 jqm的链接按预期工作。问题是iframe中的链接。我附加了一个带有两个链接的生成站点,它们加载到一个新的选项卡中,而不是加载到iFrame中。 – user1692091
可能是使用jquery移动干扰页面事件:http://www.12live.de/de/blog/javascript/ipad-stay-in-webapp-fullscreen-when-links-in-embedded-iframe-are点击/你可以尝试没有jqm的iframe。 –
谢谢,该作品:) – user1692091