Guest User

Untitled

a guest
Oct 20th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. var haha;
  2.  
  3. function ajaxfunction(){
  4. var request;
  5. var returning;
  6.  
  7. try {
  8. request = new XMLHttpRequest();
  9. } catch(e){
  10. try {
  11. request = new ActiveXObject("Msxml2.XMLHTTP");
  12. } catch(e){
  13. try {
  14. request = new ActiveXObject("Microsoft.XMLHTTP");
  15. } catch(e){
  16. }
  17. }
  18. }
  19.  
  20. request.onreadystatechange = function(){
  21. if(request.readyState == 4){
  22. haha = request.responseText;
  23. }
  24. }
  25.  
  26. request.open("GET", "pick.php", true);
  27. request.send(null);
  28. }
  29.  
  30. ajaxfunction();
  31.  
  32. if(haha == "yay"){
  33. alert("This"); // this is an example, don't know what to use instead (probably another function soon
  34. }
Add Comment
Please, Sign In to add comment