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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:52:09+00:00 2026-05-18T21:52:09+00:00

I am making an ajax request to a php page and I cannot for

  • 0

I am making an ajax request to a php page and I cannot for the life of me get it to just return plain text.

    $.ajax({
       type: 'GET',
       url: '/shipping/test.php',
       cache: false,
       dataType: 'text',
       data: myData,   
       success: function(data){
        console.log(data)
       }   
     });

in test.php I am including this script to get UPS rates. I am then calling the function with $rate = ups($dest_zip,$service,$weight,$length,$width,$height);

I am doing echo $rate; at the bottom of test.php. When viewed in a browser shows the rate, that’s great. But when I request the page via ajax I get a bunch of XML. Pastie here: http://pastie.org/1416142

My question is, how do I get it so I can just return the plain text string from the ajax call, where the result data will be a number?

Edit, here’s what I see in Firebug- Response tab:

alt text

HTML tab:

alt text

  • 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-18T21:52:10+00:00Added an answer on May 18, 2026 at 9:52 pm

    The PHP script you are using outputs XML. Look at upsRate.php and you will see a whole bunch of XML in a string.

    Also you might want to comment out line 96 of upsRate.php because it outputs some comments which you will see when you fetch the page with ajax.

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

Sidebar

Related Questions

On my page I'm making ajax-request to get data from server. The data is
I have this ajax call at the moment: $.ajax({ url: misc/sendPM.php, type: POST, data:
I am making a request to a CGI program using AJAX. The response sends
I've rewritten my family web site using JavaScript (JQuery) making Ajax calls to PHP
I'm working on a web page where I'm making an AJAX call that returns
I am making use of AJAX on my site and I would like to
What's the best practice for making sure that certain ajax calls to certain pages
I'm making a webpage with dynamic content that enters the view with AJAX polling.
Is there a norm for AJAX security? When making an XMLHttpRequest, if querying an
am making an ajax call to retrive json data i then store the retrived

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.