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 5983355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:13:07+00:00 2026-05-22T22:13:07+00:00

I am try to get a URL from a one server and using that

  • 0

I am try to get a URL from a one server and using that URL to get contents of another server.

$.ajax({url : 'http://localhost:8080/geturl.jsp?A=1&B=2,C=3',
    success : function (data)
        {
            alert(data);
            $.getJSON(data, function (mydata)
            {
                alert(mydata);
            });
        },
    error : function (data, status, xhr)
            {
            }
    });

I know that we cannot make cross-domain requests in through ajax call, thats why i am using getJSON, i have the following problems

  1. When i simply pass the data to the url part of getJSON (as shown in the code), the alert-box show the correct URL but no get request is being performed ( get requests were monitored from FireBug).
  2. When a hard-code the data to be “http://www.google.com” then the get request is being performed but the no response comes, although the response headers comes and response code is 200 (but it was marked as RED in the Firebug (Dont know why 🙁 )
  3. When I tries to fetch a webpage host in localhost domain, then it is fetched correctly although the response was not JSON.

I have the following doubts

  1. If the getJSON function accecpts only JSON objects as reponse then why no error came when perform above 3.
  2. Whats the correct code to perform my the required functionality.
  3. Suggestions to what happened in each case

Thanks in advance for the answers 🙂

  • 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-05-22T22:13:07+00:00Added an answer on May 22, 2026 at 10:13 pm

    The getJSON function can only be used across domains to fetch JSONP.
    It does not magically evade any security restrictions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When I try to do a file(' http://somewebsite.com ') i get an error URL
I face a problem when I try to get value from primary table in
I get the following error when I try to compile an asp.net site using
I continually get these errors when I try to update tables based on another
When I try to do that I get the following error: Changes to 64-bit
while creating a video player using html5 i try to load the video from
I try get the mp3 flash player to work with my javascript on all
I'm trying to use Chronic inside my non-rails project. When I try to get
is it possible to make beep in WinCE ? i try and i get
I get a generic failure when I try to run: saslpasswd2 username This was

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.