Advertisement
Guest User

Untitled

a guest
Nov 18th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. var getHTML = function ( url, callback ) {
  2. if ( !window.XMLHttpRequest ) return;
  3. var xhr = new XMLHttpRequest();
  4. xhr.onload = function() {
  5. callback( this.responseText );
  6. }
  7. xhr.open( 'GET', url );
  8. xhr.responseType = 'text';
  9. xhr.send();
  10. };
  11. var q = function (question){
  12. getHTML("https://snowkk.pythonanywhere.com/?q=" + question, console.log)
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement