below code work this with no problem
<form name="statusUpdate" action="" method="">
<textarea name="status" id="status" rows="4" cols="50"></textarea>
<input type="button" onclick="updateStatusViaJavascriptAPICalling(); return false;" value="Update Status via Facebook Javascript Library" />
</form>
}
function updateStatusViaJavascriptAPICalling(){
var status = document.getElementById('status').value;
FB.api('/me/feed', 'post', { message: status }, function(response) {
if (!response || response.error) {
alert('Error occured');
} else {
alert('Status updated Successfully');
}
});
}
i would like to change no text area and onlad with var changed,is it possible?
<body onLoad="updateStatusViaJavascriptAPICalling();" />
}
function updateStatusViaJavascriptAPICalling(){
var attachment = { 'name': 'i\'m bursting with joy', 'href': ' <A href="http://bit.ly/187gO1'" rel=nofollow>http://bit.ly/187gO1'</A>, 'caption': '{*actor*} rated the lolcat 5 stars', 'description': 'a funny looking cat', 'properties': { 'category': { 'text': 'humor', 'href': '<A href="http://bit.ly/KYbaN'" rel=nofollow>http://bit.ly/KYbaN'</A>}, 'ratings': '5 stars' }, 'media': [{ 'type': 'image', 'src': '<A href="http://icanhascheezburger.files.wordpress.com/2009/03/funny-pictures-your-cat-is-bursting-with-joy1.jpg'" rel=nofollow>http://icanhascheezburger.files.wordpress.com/2009/03/funny-pictures-your-cat-is-bursting-with-joy1.jpg'</A>, 'href': '<A href="http://bit.ly/187gO1'" rel=nofollow>http://bit.ly/187gO1'</A>}] };
FB.api('/me/feed', 'post', { message: body, attachment: attachment}, function(response)
if (!response || response.error) {
alert('Error occured');
} else {
alert('Status updated Successfully');
}
});
}
thank you