I am doing this in order to have Facebook like button in my page:
<script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script>
And after that:
<fb:like href= "" layout="button_count" show_faces="false" width="450" font=""></fb:like>
This works well. But instead of having to connect to Facebook to get the all.js
file, I would like to have that content statically in my assets. So.. I tried getting the content of that file, and putting it in a js file that is loaded in the page..
However, the button is not loading when I do that. Am I missing something? If it’s not possible to get the all.js, I believe I could cache that right?
The channel file is a file that contains this script directive. It is not the script itself. You need the channel file to help cross-domain communication in some browsers. Since channel file never changes, it is good thing to cache it right. The javascript, on the other hand, might change at some point (thing change, API evolves, etc), so you don’t need to aggressively cache it. Let Facebook do it.