Tag Archives: facebook

Twitter Web Intents Javascript Events Not Firing

If you’re trying out Twitter’s Web Intents Javascript Events and it’s not working, be aware that they only work if your HTML page is loaded from an HTTP server. If you open your page locally off your hard drive it won’t work, though you can fire up an Apache instance on your localhost and it’ll work from there.

Source: https://dev.twitter.com/comment/reply/304/491

Update: It looks like this can also happen with the Facebook JavaScript API: http://forum.developers.facebook.net/viewtopic.php?pid=362167#p362167. I guess it’s because they use iFrames, and using them locally can cause security problems.

Cookies Not Saved In Internet Explorer for Facebook iframe Apps

I’m making a Facebook game using Django and was having a problem with Internet Explorer.

The Problem: After login the page would render correctly as if the user was logged in, but when navigating to another page it was as if the user wasn’t logged in. Upon investigation I could see that the cookies weren’t being saved.

The Solution: A quick Gogole search brought me to this blog post: IE Blocking iFrame Cookies. It’s an easy to fix P3P issue, and the author describes how to add the necessary header for various languages/frameworks.

Rather than add the header to each Django view or write custom Django middleware, I just added the header to my Apache configuration. The following goes in your VirtualHost Directive:

Header add P3P ‘CP=”IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT”‘

In order to work you have to enable mod_headers (run “sudo a2enmod headers”).

WordPress Twitter Better Plugin

One great way I recently found to publicize new blog posts is with the Twitter Better WordPress Plugin. It serves 2 functions:

  • Shows your latest Twitter posts
  • Optionally updates your Twitter status when you save, publish, and/or edit a post, with a link to the post

It’s a really simple way to spread your URL around the internet, especially since Twitter is integrated with so many other web apps. For example, I have Twitter Better set to update my Twitter status when I publish a new post with the title and URL of the post. That new Twitter status is then used to automatically update my Facebook status with the title and URL of my new blog post, and the same can work for any other Twitter enabled web apps I use in the future.