Note that there are some explanatory texts on larger screens.

plurals
  1. POFacebook connect. Works in Firefox/Internet Explorer, not in Chrome/Safari/Opera
    text
    copied!<p>I have an app wich is an index.php file with javascript and when the user is logged in the javascript loads the content of the page which is stored in content.php</p> <p>(k, I've figured out that it works in safari if the user has allowed popups. I get the same error with firefox. So can popup windows be the enemy? How can i rewrite this to ton use popups?)</p> <p>Index.php:</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;My app&lt;/title&gt; &lt;link type="text/css" rel="stylesheet" href="css/style.css"/&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"&gt;&lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;div id="fb-root"&gt;&lt;/div&gt; &lt;script src="http://connect.facebook.net/en_US/all.js"&gt;&lt;/script&gt; &lt;script src="js/jquery.validationEngine.js"&gt;&lt;/script&gt; &lt;script src="js/jquery.validationEngine-en.js" type="text/javascript" charset="utf-8"&gt;&lt;/script&gt; &lt;link rel="stylesheet" href="css/validationEngine.jquery.css" type="text/css"/&gt; &lt;script src="js/functions.js"&gt;&lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>functions.js:</p> <pre><code>FB.init({ appId : '123456789', status : true, // check login status cookie : true, // enable cookies to allow the server to access the session xfbml : true // parse XFBML }); FB.login(function(response) { if (response.session) { if (response.perms) { $.get("content.php", {get: "form"}, function(data){ $('body').append(data); }); } else { top.location.href="http://example.com"; } } else { top.location.href="http://www.example.com"; } }, {perms:'publish_stream'}); </code></pre> <p>It works in Firefox and Internet Explorer but in Chrome, Safari and Opera it doesn't. I got this error in Chrome with the javascript debug:</p> <pre><code>Unsafe JavaScript attempt to access frame with URL https://www.facebook.com/login.php?api_key=123456789&amp;skip_api_login=1&amp;display=popup&amp;cancel_url=http%3A%2F%2Fstatic.ak.fbcdn.net%2Fconnect%2Fxd_proxy.php%3Fversion%3D0%23cb%3Df13bcfbe1%26origin%3Dhttp%253A%252F%252Fexample.com%252Ff1fd4b982c%26relation%3Dopener%26transport%3Dpostmessage%26frame%3Df206b2144c%26result%3D%2522xxRESULTTOKENxx%2522&amp;fbconnect=0&amp;next=https%3A%2F%2Fwww.facebook.com%2Fdialog%2Fpermissions.request%3F_path%3Dpermissions.request%26app_id%3D152123456789%26redirect_uri%3Dhttp%253A%252F%252Fstatic.ak.fbcdn.net%252Fconnect%252Fxd_proxy.php%253Fversion%253D0%2523cb%253Df13bcfbe1%2526origin%253Dhttp%25253A%25252F%25252Fexample.com%25252Ff1fd4b982c%2526relation%253Dopener%2526transport%253Dpostmessage%2526frame%253Df206b2144c%2526result%253D%252522xxRESULTTOKENxx%252522%26sdk%3Djoey%26display%3Dpopup%26api_key%3D123456789%26fbconnect%3D0%26locale%3Den_US%26method%3Dpermissions.request%26perms%3Dpublish_stream%26return_session%3D1%26session_version%3D3%26from_login%3D1&amp;rcount=1 from frame with URL http://example.com/myfacebookapp/. Domains, protocols and ports must match. </code></pre> <p>In Opera it gets stuck on a popup window (popup allowed) with this url:</p> <pre><code>http://static.ak.fbcdn.net/connect/xd_proxy.php?version=0#cb=f5132b51b60fbe&amp;origin=http%3A%2F%2Fexample.com%2Ff10a57ba8d445c&amp;relation=opener&amp;transport=flash&amp;frame=f19023256ffd8&amp;result=%7B%22perms%22%3A%22publish_stream%22%2C%22selected_profiles%22%3A1245738876%2C%22session%22%3A%22%7B%5C%22session_key%5C%22%3A%5C%222.buXjHddfcr_xKQHVeu_FXw__.3600.1299679200-1245738876%5C%22%2C%5C%22uid%5C%22%3A%5C%221245738876%5C%22%2C%5C%22expires%5C%22%3A1299679200%2C%5C%22secret%5C%22%3A%5C%22glwIAcpeG0HDT__0z1QI3g__%5C%22%2C%5C%22access_token%5C%22%3A%5C%22152384968151443%7C2.buXjHdcfcr_xKQHVeu_FXw__.3600.1299679100-1245738876%7CdyZCE5trqgMkU0HSzSorX3jqbIs%5C%22%2C%5C%22sig%5C%22%3A%5C%228724dd80df9f16e7c3a2ce1b06f8d1e1%5C%22%7D%22%7D </code></pre> <p>So my question is: How can I get this to work in all browsers (Firefox, IE, Chrome &amp; safari preferably)?</p> <p>(edit: I have changed the urls and removed codes and urls to my app)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload