Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php header('Access-Control-Allow-Origin: *'); ?>
- <script src="http://code.jquery.com/jquery-latest.js"></script>
- <script>
- (function ($) {
- $(document).ready(function () {
- $.ajax({
- // The link we are accessing.
- url: "http://horizon-websolutions.com",
- // The type of request.
- type: "get",
- // The type of data that is getting returned.
- dataType: "html",
- error: function () {
- alert("error");
- // Load the content in to the page.
- $("#output").html("<p>Page Not Found!!</p>");
- },
- beforeSend: function () {
- alert("not yet");
- },
- complete: function () {
- alert("done");
- },
- success: function (strData) {
- alert("success");
- // Load the content in to the page.
- $("#output").html(strData);
- }
- });
- // Prevent default click.
- return(false);
- });
- })(jQuery);
- </script>
- <div id="output"></div>
- (function ($) {
- // Your code here
- $(document).ready(function() {
- // ...
- });
- })(jQuery);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement