I'm trying to build an application on Facebook.com. It authenticates using PHP and stores the auth token in a variable, but then does a lot of client-side stuff using Javascript that requires the token.
I've looked through several other answers but can't seem to find one that applies to my problem. Basically, I'm trying to pass the PHP variable to Javascript using:
echo "<script>
var auth_token = '$auth_code';
</script>";
It seems simple enough, but when I try to pass an authorization token provided by Facebook from PHP to JS, it doesn't work. No value appears in the code, and it seems to throw strange errors on external pages:
GET http://0.49.channel.facebook.com/x/3638925121/3718215131/true/p_643080342=76 undefined (undefined)
Is there a way to do this easily? Or will I have to authenticate using Javascript?
Thanks!