Hello I’m trying to develop facebook open graph system for my website and I’m almost done…
It requires current page url to be posted to run the action..I got current page url using document.url to a java script variable called BASE but I don’t know how to place it inside a javascript because it always shows variable name intead of url when I look at page source…
var base = document.URL;
function postCook()
{
FB.api(
'/me/video.watches',
'post',
{ video: CURRENT PAGE URL SHOULD BE HERE},
function(response) {
if (!response || response.error) {
alert('Error occured');
} else {
alert('Cook was successful! Action ID: ' + response.id);
}
});
}
When you look at the page source, you see the code that was sent from the server. Just put the variable there and it should work.
or