Advertisement
Guest User

Untitled

a guest
Mar 26th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. <?php header('Access-Control-Allow-Origin: *'); ?>
  2.  
  3. <script src="http://code.jquery.com/jquery-latest.js"></script>
  4. <script>
  5. (function ($) {
  6. $(document).ready(function () {
  7. $.ajax({
  8. // The link we are accessing.
  9. url: "http://horizon-websolutions.com",
  10. // The type of request.
  11. type: "get",
  12. // The type of data that is getting returned.
  13. dataType: "html",
  14. error: function () {
  15. alert("error");
  16. // Load the content in to the page.
  17. $("#output").html("<p>Page Not Found!!</p>");
  18. },
  19. beforeSend: function () {
  20. alert("not yet");
  21. },
  22. complete: function () {
  23. alert("done");
  24. },
  25. success: function (strData) {
  26. alert("success");
  27. // Load the content in to the page.
  28. $("#output").html(strData);
  29. }
  30. });
  31. // Prevent default click.
  32. return(false);
  33. });
  34. })(jQuery);
  35. </script>
  36. <div id="output"></div>
  37.  
  38. (function ($) {
  39. // Your code here
  40. $(document).ready(function() {
  41. // ...
  42. });
  43. })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement