Open ColorBox from iFrame to Parent Window

function iframecode(url, w, h) {
window.parent.$.colorbox({href:url, iframe: true, scrolling: false, width: w, height: h});

}

var headID = window.parent.document.getElementsByTagName("head")[0];         
var newScript = window.parent.document.createElement('script');
newScript.type = 'text/javascript';
newScript.src = 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js';
headID.appendChild(newScript);

var headID = window.parent.document.getElementsByTagName("head")[0];         
var cssNode = window.parent.document.createElement('link');
cssNode.type = 'text/css';
cssNode.rel = 'stylesheet';
cssNode.href = 'http://demo.svnlabs.com/colorbox/example3/colorbox.css';
cssNode.media = 'screen';
headID.appendChild(cssNode);

var headID = window.parent.document.getElementsByTagName("head")[0];         
var newScript = window.parent.document.createElement('script');
newScript.type = 'text/javascript';
newScript.src = 'http://demo.svnlabs.com/colorbox/colorbox/jquery.colorbox.js';
headID.appendChild(newScript);

Uses:
onClick=”iframecode(‘https://www.svnlabs.com/’, ‘80%’, ‘80%’);”

Amazon S3 & Facebook Fanpage app

I want to link Amazon S3 https object like “https://s3.amazonaws.com/bucket/index.html” to facebook iframed fan page…
But it returned error….

405 Method Not Allowed
Code: MethodNotAllowed
Message: The specified method is not allowed against this resource.
ResourceType: OBJECT
Method: POST
RequestId: XXXXXXXXXXXXX
HostId: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

OR

PreconditionFailedAt least one of the pre-conditions you specified did not holdBucket POST must be of the enclosure-type multipart/form-data….. πŸ™

OR

<Error>
<Code>PreconditionFailed</Code>
<Message>At least one of the pre-conditions you specified did not hold</Message>
<Condition>Bucket POST must be of the enclosure-type multipart/form-data</Condition>
<RequestId>F681CE6EB61CFAA3</RequestId>
<HostId>hMQd22w34G0TpwISr1gQDB/TdUniRjhJ355Scc9RxOWreDDb5XWYwEFzutkhjX72</HostId>
</Error>

After few searches I got link…. but not helpful πŸ™
http://www.hyperarts.com/blog/facebook-secure-browsing-https-iframe-tabs-mixed-content-warnings/

Finally, I got good article on AWS Forum..
https://forums.aws.amazon.com/thread.jspa?messageID=228930

I came to know that facebook loads the requested HTTPS S3 URL “https://s3.amazonaws.com/bucket/index.html” by sending a form POST and injected some content into the iframe, but S3 have POST for file uploading only… so it returned “MethodNotAllowed”

Bucket Policies won’t work in this condition… πŸ™

Now, I have few options to use S3 HTTPS Object “https://s3.amazonaws.com/bucket/index.html” in facebook iframed fan page…

1. Run a HTTPS Apache server that can load S3 HTTPS Object with POST method and supply to fan page πŸ™‚
2. Load S3 HTTPS Object using another iframe on any server… see code below

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="https://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Facebook Fan Page - Amazon S3</title>
</head>

<body>
<iframe frameborder="0" style="width: 520px; height: 800px;" src="https://s3.amazonaws.com/svwpmu/index.html" scrolling="no"></iframe>
</body>
</html>

You can check videos released on blog 9th May 2011 for more detailed installation…

I have partnered with Shelle Kind of facebook social marketing and we have released the Amazon S3 / EC2 Solution for Facebook fanpage apps.

Partner: Shelle-K | Custom graphic and web developer

When MIND is weak situation is a PROBLEM, when MIND is balanced situation is CHALLENGE, when MIND is strong situation is an OPPORTUNITY πŸ˜‰