The website declined to show this webpage

378 views
Skip to first unread message

cis

unread,
Mar 13, 2012, 2:44:09 PM3/13/12
to easyxdm
Hi everyone. Am hoping someone can assist me to get easyXDM working.

I've followed the examples and docs as best as I can, but my
configuration is slightly different than any others I've seen. Some
facts:

PROBLEM: After configuring easyXDM in my page, IE8 reports an error of
"The website declined to show this webpage" - HTTP 403. Safari 5.1.1
displays nothing in the iFrame at all - no error, no content.

The log on IE8 is:
localhost:1363 - 12:44:26.531:{Private}: firing dom_onReady
localhost:1363 - 12:44:26.546:... deferred messages ...
localhost:1363 - 12:44:26.546:easyXDM.Socket: constructor
localhost:1363 - 12:44:26.562:{Private}: preparing transport stack
localhost:1363 - 12:44:26.562:{Private}: resolved url 'http://
localhost:1363/Examples/resize_intermediate.html?url=http://
www.amazon.com/reviews/iframe?akid=AKIAJZH6GDK7AR2Y4XZA&alinkCode=xm2&asin=B003V360NY&atag=wwwribbonscom-20&exp=2012-03-14T17%3A42%3A51Z&v=2&sig=dQr33m5f6q3ndEarYKNs%2F2d7LUh4vlmJ1yG8s5QKhWQ%3D'
localhost:1363 - 12:44:26.593:{Private}: selecting protocol: 4
localhost:1363 - 12:44:26.593:easyXDM.stack.SameOriginTransport:
constructor
localhost:1363 - 12:44:26.609:easyXDM.stack.QueueBehavior: constructor
localhost:1363 - 12:44:26.609:... end of deferred messages ...
localhost:1363 - 12:44:26.625:easyXDM.stack.SameOriginTransport: init
localhost:1363 - 12:44:26.640:{Private}: creating frame:
http://localhost:1363/Examples/resize_intermediate.html?url=http://www.amazon.com/reviews/iframe?akid=AKIAJZH6GDK7AR2Y4XZA&alinkCode=xm2&asin=B003V360NY&atag=wwwribbonscom-20&exp=2012-03-14T17%3A42%3A51Z&v=2&sig=dQr33m5f6q3ndEarYKNs%2F2d7LUh4vlmJ1yG8s5QKhWQ%3D&xdm_e=http%3A%2F%2Flocalhost%3A1363%2FExamples%2FItemLookup.aspx&xdm_c=default1045&xdm_p=4
localhost:1363 - 12:44:26.656:{Private}: HAS_NAME_PROPERTY_BUG: false
localhost:1363 - 12:44:27.843:easyXDM.Fn: storing function default1045
localhost:1363 - 12:44:28.609:easyXDM.Fn: retrieving function
default1045
localhost:1363 - 12:44:28.906:easyXDM.stack.QueueBehavior: removing
myself from the stack

-----------------------

The log on Safari 5.1.1 is:
localhost:1363 - 12:54:52.313:{Private}: firing dom_onReady
localhost:1363 - 12:54:52.315:... deferred messages ...
localhost:1363 - 12:54:52.317:easyXDM.Socket: constructor
localhost:1363 - 12:54:52.318:{Private}: preparing transport stack
localhost:1363 - 12:54:52.319:{Private}: resolved url 'http://
localhost:1363/Examples/resize_intermediate.html?url=http://
www.amazon.com/reviews/iframe?akid=AKIAJZH6GDK7AR2Y4XZA&alinkCode=xm2&asin=B003V360NY&atag=wwwribbonscom-20&exp=2012-03-14T17%3A53%3A17Z&v=2&sig=LaFUl3Ertl%2FJKvW%2FgWERV%2FJybg6MEx1uROy5oEJ%2Fi9s%3D'
localhost:1363 - 12:54:52.321:{Private}: selecting protocol: 4
localhost:1363 - 12:54:52.322:easyXDM.stack.SameOriginTransport:
constructor
localhost:1363 - 12:54:52.323:easyXDM.stack.QueueBehavior: constructor
localhost:1363 - 12:54:52.324:... end of deferred messages ...
localhost:1363 - 12:54:52.326:easyXDM.stack.SameOriginTransport: init
localhost:1363 - 12:54:52.329:{Private}: creating frame:
http://localhost:1363/Examples/resize_intermediate.html?url=http://www.amazon.com/reviews/iframe?akid=AKIAJZH6GDK7AR2Y4XZA&alinkCode=xm2&asin=B003V360NY&atag=wwwribbonscom-20&exp=2012-03-14T17%3A53%3A17Z&v=2&sig=LaFUl3Ertl%2FJKvW%2FgWERV%2FJybg6MEx1uROy5oEJ%2Fi9s%3D&xdm_e=http%3A%2F%2Flocalhost%3A1363%2FExamples%2FItemLookup.aspx&xdm_c=default2136&xdm_p=4
localhost:1363 - 12:54:52.332:{Private}: HAS_NAME_PROPERTY_BUG: false
localhost:1363 - 12:54:52.554:easyXDM.Fn: storing function default2136
localhost:1363 - 12:55:07.451:easyXDM.Fn: retrieving function
default2136
localhost:1363 - 12:55:07.576:easyXDM.stack.QueueBehavior: removing
myself from the stack

----------------------------------

This is about as much as I can tell you about the problem. I don't
really understand what easyXDM does to accomplish what it's doing. I
know very little about Javascript.

Some things you should know:

I am developing a Web Application using .NET 3.5 on Windows XP
Professional using Visual Studio 2010 w/SP1. The content is retrieved
from Amazon's Product Advertising API. I have no control over that
data. My application makes a REST request and Amazon's response is in
XML. My application uses XSLT to transform their response into HTML.

My application also uses Master pages and Nested Master pages. Maybe
this isn't important, but I mention these things because you should
know that I am not putting the easyXDM initialization in the 'main'
<HEAD> at this point. I tried putting it there initially, but was
having this identical problem so I placed the easyXDM <SCRIPT> inside
the <HEAD> of the XSLT that gets transformed. No matter which place I
put the <SCRIPT>, the problem is identical. I don't think this is the
problem.

The reason I place the easyXDM <SCRIPT> initialization code in the
XSLT is because this is where I have easy access to the URL of the
iFrame content. My XSLT inserts the URL and an example (actual) result
is:

In my.xslt:

<script type="text/javascript">

var transport = new easyXDM.Socket(/** The configuration */{
remote: "resize_intermediate.html?url=http://www.amazon.com/
reviews/iframe?
akid=AKIAJZH6GDK7AR2Y4XZA&alinkCode=xm2&asin=B003V360NY&atag=wwwribbonscom-20&exp=2012-03-14T17%3A42%3A51Z&v=2&sig=dQr33m5f6q3ndEarYKNs
%2F2d7LUh4vlmJ1yG8s5QKhWQ%3D",
swf: "easyxdm.swf",
container: "embedded",
onMessage: function (message, origin) {
this.container.getElementsByTagName("iframe")
[0].style.height = message + "px";
}
});

</script>

The 'embedded' <DIV> is also in my.xslt, though I've also tried
putting all of this code in the main .ASPX page with the same results.

So you know, I've placed both resize_intermediate.html and easyxdm.swf
in the same folder as my page to eliminate the possibility that either
of these files are not found. I'm not sure how to tell if they are
being found or not, I'm sure the html file is found, not positive the
swf file is... I don't get any errors about that.

If I remove the 'resize_intermediate.html?url=' from the remote: line,
easyXDM is successful in making the request/getting a response and
placing the content into the iFrame, but it does not do any sizing of
the iFrame whatsoever. All I get at that point is a small iFrame with
vertical and horizontal scrollbars.

The only change I've made to resize_intermediate.html is to correct
the path to the easyXDM .js file:

<script src="../Scripts/easyXDM/easyXDM.debug.js" type="text/
javascript"></script>


In my .ASPX page, I have the following:

<script src="../Scripts/jquery-1.7.1.min.js" type="text/javascript"></
script>
<script src="../Scripts/easyXDM/easyXDM.debug.js" type="text/
javascript"></script>

<style type="text/css">
html, body {
/* overflow: hidden;*/
margin: 0px;
padding: 0px;
width: 100%;
/* height: 100%; */
}

iframe {
width: 1000;
/* width: 100%; */
/* height: 100%; */
border: 0px;
}
</style>

For some reason I have to comment out the 'overflow: hidden;' line,
otherwise IE does not have a scrollbar for the page.

I'm guessing one of two things. Either the extra '?' in the URL is
throwing easyXDM off, or Amazon's servers can somehow detect that the
content is destined for other than an iFrame on my page. I'm only
guessing....

Have I given you enough information to get an idea of why this is
happening? Is there a fix for this problem? Or, am I just doing
something wrong? :S

Hope I haven't overwhelmed you with unneccessary detail.

Thanks!

Øyvind Sean Kinsey

unread,
Mar 16, 2012, 1:19:49 PM3/16/12
to eas...@googlegroups.com
Sorry, don't have much time to answer, but you know that you must have a socket on both the parent and the child page right?
And that if you are using the resize example as a base, that the intermediary page has to be on the same origin as the page you want to resize?

Looks to me like you are calling a child on the same origin (relative url to remote), and the page you are trying to resize is amazon...
Reply all
Reply to author
Forward
0 new messages