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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:49:37+00:00 2026-05-22T20:49:37+00:00

I am trying to do an ajax Call using jquery in one of my

  • 0

I am trying to do an ajax Call using jquery in one of my webpages.

It’s going into Error function all the time.
When I look at the console in Firebug, the status seems to be ok , it displays 200 OK.

And when I manually launch the url in a firefox window, i am getting the expected page.

But when the same url is being called through jquery ajax, it always goes into the error function.

Following are the various values that i got during debug
xhr.readyState=4
xhr.statusText=Error
xhr.responseBody=undefined.

Could anyone of you please help me with this ?

function ajax_call(urlString)
        {
            ret_val="";
            $.ajax
            (
                {
                    type: "GET",
                    url: urlString,
                    async:false,
                    cache:false,
                    success: function(msg)
                    {
                        ret_val=msg;
                    },
                    error:function (xhr, textStatus, thrownError)
                    {
                        ret_val=xhr.readyState;
                        alert("textStatus=" +textStatus);
                    }
                }
            );
            return ret_val;
        } 
  • 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-22T20:49:38+00:00Added an answer on May 22, 2026 at 8:49 pm

    It was my mistake !

    In the browser URL , i was looking at
    “http://localhost/data.php”

    in the AJAX call , i was calling the same php by giving absolute url like
    “http://xyz.com/data.php”

    as a result, ajax call was considering this as a cross domain call, although it was for the same php.

    Resolved this by calling the relative url
    “/data.php”

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

Sidebar

Related Questions

I'm trying to get all loop results into one then using ajax to send
I trying to make my first AJAX with JSON call using jQuery and CodeIgniter.
I am trying to invoke webservice using jquery ajax call. I am using jasonp
I'm trying to to make AJAX call with the jQuery library using the $.ajax()
I am trying to make an ajax call using jquery in my spring MVC
Am I missing something? I'm trying to do a simple ajax call using jquery
I am trying to make an Ajax call using JQuery to a servlet that
I am trying to make an AJAX call using jQuery to a C# Web
I am trying to perform a nested AJAX call using the following code. The
I am trying to make an ajax call using $.get() where I want to

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.