How To Call Javascript Of Facebook Api For Sending Dynamic Values In Order To Post In Wall
I have a parent page where I am submiting a form and calling two funcions on_click of the submit button. One function from the same page and another from child page. I am wondering
Solution 1:
Well if lets say the parent window opens a child popup window, then do as following
EDIT :
Your parent page, parent.php
<script>varPopup;
functionpopUp()
{
Popup = window.open("child.php", "bpPopup", 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=420,height=300,left = 490,top = 262');
Popup.focus();
}
</script><ahref="javascript:void(0)"onclick="popUp();">Open child window</a><br /><ahref="javascript:void(0)"onclick="Popup.postToFeed();">Call child window function</a>
First link opens popup window, second link calls the function postToFeed()
in popup window from parent.
Your child popup window, child.php
<script>functionpostToFeed(){
alert("Popup function called by parent window");
}
</script>
This function in popup window is called after you click the link in parent window.
Hope This helps!
Solution 2:
I'd have a PHP script that your form submits to, that posts to the Facebook feed. The reason being, it will still work if JavaScript is not available for some reason. You can then use JavaScript to submit the form via AJAX, which will have the result you want.
Post a Comment for "How To Call Javascript Of Facebook Api For Sending Dynamic Values In Order To Post In Wall"