javascript - Posting to a Facebook wall using a single function -
Overview: I found a website whose sentences are Facebook Post on, but in each sentence there are input boxes, people who can change the default value. As with a digital "crazy leebe", each row has a button that will post the line to Facebook. Help with: After having the same function to post data on the button press, I have different function names on Facebook Could give and could add the variable, but it dashed the purpose of the function. HTML SCRIPT I do not know the FB API, but if you can only post a copy Request message, then you can create an array of messages and then loop through it to post. This will be said if the user clicks on a button if it is not If you want, please give us some more information so that we can help: D
& lt; Div id = "post1" & gt; & Lt; Span & gt; I like & lt; / Span & gt; & Lt; Input name = "post1_1" value = "tom" type = "text" id = "post1_1" /> & Lt; Span & gt; I think he is & lt; / Span & gt; & Lt; Input name = "post1_2" value = "good" type = "article" id = "post1_2" /> & Lt; A href = "javascript: post (post 1)" & gt; Post Now & lt; / A & gt; & Lt; / Div & gt; & Lt; Div id = "post2" & gt; & Lt; Span & gt; My website & lt; / Span & gt; & Lt; Input name = "post2_1" value = "great" type = "article" id = "post2_1" /> & Lt; A href = "javascript: post (post 2)" & gt; Post Now & lt; / A & gt; & Lt; / Div & gt;
function postonwall (post1, post 2) {var post1_1 = null; Var post1_2 = Faucet; Var post2_2 = null; Var post2_3 = null; Var post1_1 = $ ("# post1_1") Val (); Var Post 1 = "I Like" + Post 1_1 + "I Think It Is" + 1 Post; Var post2_1 = $ ('# post2_1') Val (); Var Post 2 = "My Website Is" + Post 2_1; FB.api ('/ me / feed', 'post', {message: post1, message: post2}, function (feedback) {if (! Response || response.error) {alert ('Oops! User Disapproved Access' );} And {Alerts ('success: content published');}}); }
var messages = [msg1, msg2, msg3]; (In the message var i) {// here comes your code to post on Facebook}
Comments
Post a Comment