为什么URL转发后该网页显示不一样?

发布于 2024-11-04 04:49:45 字数 894 浏览 5 评论 0原文

我正在开发一个简单的 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 技术交流群。

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

发布评论

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

评论(2

独夜无伴 2024-11-11 04:49:45

你确定你没有进行帧转发吗?我在 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">

它们在框架转发版本中不起作用,因为它们嵌套在框架内而不是根页面上。

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:

<!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>

Notice the frame tag:

<frameset frameborder="0" framespacing="0" border="0" rows="100%,*">
        <frame name="MYTOPFRAME" src="http://www.codeemporium.com/experiments/map5.html" noresize>

This is what happens when you frame forward.

Since your sizing relies on additions to the HTML tag:

<html class="ui-mobile landscape min-width-320px min-width-480px min-width-768px min-width-1024px">

They do not work in the frame-forwarded version because they are nested inside the frame and not on the root page.

述情 2024-11-11 04:49:45

这是因为 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>

您需要实际上改变那个框架去做正确的事。

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:

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>

You'll need to actually change that frame set to do the right thing.

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