Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7718635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T03:12:50+00:00 2026-06-01T03:12:50+00:00

I just can’t get the ajax service to work. A simple class to $.get(http://google.com)

  • 0

I just can’t get the ajax service to work. A simple class to $.get("http://google.com") does not work. Also, this code does not work, too:

<html>
    <head>
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    </head>
    <body>
        <script>

        $.ajax({
            url:        "http://google.com",
            dataType:   "html",
            success:    function(data, status) {
                console.log("Success:");
                console.log("    Data: " + data);
                console.log("    Status: " + status);
            },
            error:      function(request, status, error) {
                console.log("Error:");
                console.log("    Request: " + request);
                console.log("    Status: " + status);
                console.log("    Error: " + error);
            },
        });

        </script>
    </body>
</html>

saved in test.html.

This is the output on the console:

Error:
    Request: [object Object]
    Status: error
    Error:

And these are the, I guess, important values of the returned object:

readyState          0
responseText        ""
status              0
statusText          "error"

Why does the request not work?
Thank you,

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T03:12:51+00:00Added an answer on June 1, 2026 at 3:12 am

    You can’t use AJAX to access cross-domain scripts like that. This is because of the Same Origin Policy — something which has been implemented for security reasons:

    This mechanism bears a particular significance for modern web
    applications that extensively depend on HTTP cookies to maintain
    authenticated user sessions, as servers act based on the HTTP cookie
    information to reveal sensitive information or take state-changing
    actions. A strict separation between content provided by unrelated
    sites must be maintained on client side to prevent the loss of data
    confidentiality or integrity.

    So you have a few options:

    1. Just call scripts on your own server
    2. Call scripts on your server which can communicate with third-party sites/apps/scripts
    3. Use either JSONP or XML as a callback format.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just can't get this thing. How is ZeroClipboard supposed to work? Why does
I just can't seem to get localization to work. I have a class library.
I've installed cx_Oracle (repeatedly) and I just can't get it to work on my
i have this simple code i just can't get it working. <html> <head> <script
I just can't get this thing to work in javascript. So, I have a
I know its pretty basic but I just can't get it to work. it
Just can not find how to install root certificate on Windows Phone 7. Does
I just can't figure it out, why i get this error. It is not
Today somebody told me that interface implementation in C# is just Can-Do relationship, not
No doubt I'm missing something really simple here but I just can't see the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.