Advertisement
Guest User

Untitled

a guest
Dec 10th, 2016
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. URL yahoo = new URL("http://www.stackoverflow.com/");
  2. BufferedReader in = new BufferedReader(
  3. new InputStreamReader(
  4. yahoo.openStream()));
  5.  
  6. String inputLine;
  7.  
  8. while ((inputLine = in.readLine()) != null)
  9. System.out.println(inputLine);
  10.  
  11. in.close();
  12.  
  13. <script>
  14. function dosubmit() {
  15. var url = document.getElementById("url-input").value;
  16. $.ajax({
  17. url:url,
  18. crossOrigin: true,
  19. success: function(response){
  20. alert(response);
  21. },
  22. error: function (XMLHttpRequest, textStatus, errorThrown) {
  23. alert(errorThrown);
  24. }
  25. })
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement