为什么URL转发后该网页显示不一样?
我正在开发一个简单的 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 ...
I have a simple Google maps web application I'm working on. I have purchased a domain name for the application (http://www.jcunav.com), which during my testing, is designed to simply forward to a page which is hosted on my another domain name of mine (http://www.codeemporium.com/experiments/map5.html). Testing on my Android Nexus S, I am noticing strange behaviour however - if I visit http://www.codeemporium.com/experiments/map5.html directly, then the app displays as intended - the map is the size I want and clicking the "About" link brings up a dialog the size I want. If I visit http://www.jcunav.com however (which, keep in mind, simply forwards to http://www.codeemporium.com/experiments/map5.html), the map displays at what looks like a more zoomed out level, and pressing the "About" link at the bottom of the page shows a dialog box which also appears more zoomed out. My question is, what could be causing this to occur, given that all http://www.jcunav.com is doing is forwarding to http://www.codeemporium.com/experiments/map5.html...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你确定你没有进行帧转发吗?我在 firebug 中检查了您提供的每个链接的页面,在我看来您正在框架转发 URL。这会导致您的目标页面在呈现给最终用户时被“包装”在框架中。这很有可能就是它对你不起作用的原因。
以下是转发页面内容的有损版本:
注意框架标记:
这就是转发页面时发生的情况。
由于您的大小调整依赖于 HTML 标记的添加:
它们在框架转发版本中不起作用,因为它们嵌套在框架内而不是根页面上。
Are you certain you aren't frame-forwarding? I examined the page in firebug for each of the links you provided and it appears to me that you are frame-forwarding the URL. This results in your target page being 'wrapped' in a frame when presented to the end user. Odds are high that this is why it is not working for you.
Here is a somewhat lossy version of what is in the forwarded page:
Notice the frame tag:
This is what happens when you frame forward.
Since your sizing relies on additions to the HTML tag:
They do not work in the frame-forwarded version because they are nested inside the frame and not on the root page.
这是因为 http://www.jcunav.com 没有转发到 http://www.codeemporium.com/experiments/map5.html,它正在将其加载到框架中:
您需要实际上改变那个框架去做正确的事。
That's because http://www.jcunav.com is not forwarding to http://www.codeemporium.com/experiments/map5.html, it is loading it into a frame:
You'll need to actually change that frame set to do the right thing.