通过Http传递querystring参数的问题获取到IE中的iframe [英] Issue with passing querystring parameters via Http Get to an iframe in IE

查看:258
本文介绍了通过Http传递querystring参数的问题获取到IE中的iframe的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我上一个问题的后续操作:通过Iframe传递参数的问题在IE




$ b




$ b < blockquote>

我试图执行HTTP GET从
我的网站到另一个网站是
通过iframe引入。



在Firefox上,您可以在源代码
中看到正确的网址是在iframe
src中,并且它的正确的
参数 - 并且它工作。



在IE中,你可以在源代码中看到
正确的url在iframe src
中,并且它是正确的参数 -
和它doesn 't work ...



有没有关于IE的东西,
不允许你通过querystring中的iframe传递参数
? / p>

我尝试刷新
IE中的iframe,我尝试刷新我的页面&
在IE中的iframe,我试过
复制该URL并重新粘贴到
iframe src(强制它刷新
,如果我刚刚输入该iframe窗口的
地址栏)。
仍然没有运气!



任何人都知道为什么会发生这种情况,或者
有任何建议尝试获得
? / p>

至于代码,它所做的就是创建
从后端代码页面
加载src并设置src属性
从后端...




  //设置src的后端代码
mainIframe.Attributes [src] = srcWeJustCreated;

//前端iframe代码
< iframe id =mainIframerunat =server/>






我已为您建立了一个临时帐户登录,看看我的意思。这样,你可以使用firebug或任何其他调试技术来弄清楚为什么这不工作,而不是让我尝试解释发生了什么。



编辑:更改了帐户凭据。请改用 href =http://www.oneworldunited.com/MyWorld.aspx =nofollow noreferrer>此链接访问登录页面。使用上述凭据登录后,您将进入主后端页面。点击左侧的图片,说假期,这将带你到一个页面的iframe,并将执行Http从那里获取。



如果你需要更多



感谢,

Matt

/ p>

解决方案

通过 Fiddler2 ,比较不同的浏览器,我发现IE使请求很好,但未能设置任何cookie在 iframe



我也注意到,如果我自己打开框架的页面它工作。更重要的是,在再次注销后,iframed版本也工作了。这是因为它已经有一个会话cookie, iframe 不再需要设置它。



这是已知的安全限制:IE会阻止iframe中的Cookie。但是,使用隐私权偏好平台(P3P)可以克服这一问题。



这里有几个链接,应该帮助你解决这个问题。从StackOverflow上的另一个(已回答的)问题开始:




This is a follow up to my previous question: Problem passing parameters via Iframe in IE. Which was never solved.


Here's the core of it:

I'm trying to execute an HTTP GET from my website to another website that is brought in via iframe.

On Firefox, you can see in the source that the correct url is in the iframe src along with it's correct parameters-- and it works.

On IE, you can see in the source that the correct url is in the iframe src along with it's correct parameters-- and it doesn't work...

Is there something about IE that doesn't let you pass parameters through an iframe in the querystring?

I've tried refreshing the iframe in IE, I've tried refreshing my page & the iframe in IE, and I've tried copying the url and re-pasting it into the iframe src (forcing it to refresh as if I just entered it into the address bar for that iframe window). Still no luck!

Anyone know why this is happening, or have any suggestions to try to get around this?

As for the code, all it's doing is creating the src from the backend code on page load and setting the src attribute from the back end...

//Backend code to set src
mainIframe.Attributes["src"] = srcWeJustCreated;

//Front end iframe code
<iframe id="mainIframe" runat="server" />


I've made a temporary account for you to login and see exactly what I mean. That way you can use firebug or any of your other debugging techniques to figure out why this isn't working rather than having me try to explain what's going on.

EDIT: Changed the account credentials. Please use this one instead
Username: matt
Password: globalbuying

Please follow this link to get to the login page. One you login with the above credentials it will take you to the main backend page. Click the image on the left that says "Vacations", that will take to you a page with the iframe and will execute the Http Get from there.

If you need more details on what's going on in the behind code, etc., let me know and I'll post them.

Thanks,
Matt

解决方案

After working my way through the HTTP requests with Fiddler2, comparing different browsers, I found that IE makes the request just fine, but fails to set any cookies in the iframe.

I also noticed that if I open that framed page by itself it does work. Even more so, after logging out again there, the iframed version works too. That's because it then already has a session cookie and the iframe no longer needs to set it.

It turns out that this is a known security restriction: IE blocks cookies in iframes. But this can be overcome with the use of the Platform for Privacy Preferences (P3P).

Here are a few links that should help you fix the problem. Starting off with another (answered) question on StackOverflow:

这篇关于通过Http传递querystring参数的问题获取到IE中的iframe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆