我正在开发一个简单的 Google 地图网络应用程序。我为该应用程序购买了一个域名 (http://www.jcunav.com),在我的测试期间,该域名旨在简单地转发到我的另一个域名 (http://www .codeemporium.com/experiments/map5.html)。在我的 Android Nexus S 上进行测试,但是我注意到奇怪的行为 - 如果我直接访问http://www.codeemporium.com/experiments/map5.html,那么应用程序会按预期显示 - 地图是我想要的大小并单击“关于”链接会弹出一个我想要的大小的对话框。但是,如果我访问http://www.jcunav.com(请记住,它只是转发到http://www.codeemporium.com/experiments/map5.html),地图以看起来更缩小的水平显示,并且按下页面底部的“关于”链接会显示一个对话框,该对话框也看起来更缩小。我的问题是,考虑到所有http://www.jcunav.com正在做的事情是转发到http://www.codeemporium.com/experiments/map5.html ,可能会导致这种情况发生。
问问题
137 次
2 回答
2
你确定你不是帧转发吗?我在 firebug 中检查了您提供的每个链接的页面,在我看来,您正在对 URL 进行帧转发。这会导致您的目标页面在呈现给最终用户时被“包裹”在一个框架中。这就是为什么它不适合你的可能性很高。
这是转发页面中内容的一个有点有损的版本:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>JCU Nav</title>
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</head>
<frameset frameborder="0" framespacing="0" border="0" rows="100%,*">
<frame name="MYTOPFRAME" src="http://www.codeemporium.com/experiments/map5.html" noresize>
-- snip --
</frameset>
</html>
注意框架标签:
<frameset frameborder="0" framespacing="0" border="0" rows="100%,*">
<frame name="MYTOPFRAME" src="http://www.codeemporium.com/experiments/map5.html" noresize>
这就是您向前构图时发生的情况。
由于您的大小取决于对 HTML 标记的添加:
<html class="ui-mobile landscape min-width-320px min-width-480px min-width-768px min-width-1024px">
它们在框架转发版本中不起作用,因为它们嵌套在框架内而不是在根页面上。
于 2011-05-01T05:02:52.980 回答
1
那是因为http://www.jcunav.com没有转发到http://www.codeemporium.com/experiments/map5.html,而是将其加载到框架中:
C:\Documents and Settings\blah>wget -S -O - http://www.jcunav.com/
--01:05:21-- http://www.jcunav.com/
=> `-'
Resolving www.jcunav.com... 66.150.161.141, 69.25.27.173, 63.251.171.80, ...
Connecting to www.jcunav.com|66.150.161.141|:80... connected.
HTTP request sent, awaiting response...
HTTP/1.1 200 OK
Date: Sun, 01 May 2011 05:01:11 GMT
Server: Apache/2.0.49 (Unix) PHP/4.3.9
X-Powered-By: PHP/4.3.9
Content-Length: 823
Connection: close
Content-Type: text/html; charset=ISO-8859-1
Length: 823 [text/html]
0% [ ] 0 --.--K/s <
!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
"http://www.w3.org/TR/html4/frameset.dtd">
<html>
<head>
<title>JCU Nav</title>
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
</head>
<frameset frameborder="0" framespacing="0" border="0" rows="100%,*">
<frame name="MYTOPFRAME" src="http://www.codeemporium.com/experiments/map5.html" noresize>
<noframes>
<body>
<h1>JCU Nav</h1>
<br>
<br>
<br>
Click here to enter <a href="http://www.codeemporium.com/experiments/map5.html">http://www.codeemporium.com/e
xperiments/map5.html</a>
<hr>
| Domain Name Registration and Domain Name Forwarding by <a href="http://www.mydomain.com">mydomain.com - Register your
domain name</a>
</body>
</noframes>
</frameset>
</html>
您需要实际更改该框架集以执行正确的操作。
于 2011-05-01T05:03:34.340 回答