Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2015
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. $("ID OU CLASS DO BOTÃO OU DO FORM").submit(function(e) {
  2. e.preventDefault();
  3. data_string = "channel=" + CANALAQUI;
  4. $.ajax({
  5. type: "POST",
  6. url: "LINK",
  7. data: data_string,
  8. dataType: "text",
  9. cache: false,
  10. success: function (data) {
  11. if(data == "followed") {
  12. document.getElementById("IDDOBOTAO").innerHTML = "HTML AQUI";
  13. }
  14. }
  15. });
  16. return false;
  17. });
  18.  
  19.  
  20. NO PHP:
  21.  
  22. $channel_name = $_POST["channel"]
  23. $twitch_functions->follow($channel_name, $_SESSION['twitch_token'])
  24. echo "yes";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement