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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:33:28+00:00 2026-06-02T18:33:28+00:00

On http://83.150.87.220/HelsinkiViSe/helsinki-map-application/ajax_test.php you can send a very simple async HTTP request when pushing the

  • 0

On http://83.150.87.220/HelsinkiViSe/helsinki-map-application/ajax_test.php you can send a very simple async HTTP request when pushing the button on top of the page.
Bellow is the code for it:

var xmlString = "<request><session></session><target_id>20</target_id></request>";

// Build the URL to connect to
var url = "http://83.150.87.220/HelsinkiViSe.dll/load";

$.ajax({ 
    type: "POST", 
    url: url,
    dataType: 'application/xml',
    data: xmlString, 
    success: function(msg) { 
        //var data = JSON.parse(msg); 
        $("#text").html(msg); 
    },
    error: function(jqXHR, textStatus, errorThrown) {
        $("#text").html(jqXHR+'<br>'+textStatus+'<br>'+errorThrown); 
    }
});

As you can see, the request data block is a simple piece of XML:

var xmlString = "<request><session></session><target_id>20</target_id></request>";

The back-end script is supposed to respond with an XML block as well, which it does (monitoring communication using Firebug and Chrome’s “code inspector”). This block is:

<?xml version="1.0" encoding="UTF-8"?>
<response>
  <target>
    <target_id>20</target_id>
    <plot>20803/3</plot>
    <builder>(makasiini L3)</builder>
    <housing_form>avoin</housing_form>
    <block_name>JätkäHieta</block_name>
    <finnish_year></finnish_year>
    <target_name></target_name>
    <target_address></target_address>
    <office_space></office_space>
    <purpose></purpose>
    <reservations></reservations>
    <contacts></contacts>
  </target>
  <status>OK</status>
  <errormsg></errormsg>
</response>

The problem is that the error handler launches nevertheless, and the success handler doesn’t. And this is giving me white hairs. Do you know what might the cause for this be and how to fix it?

Thanks in advance.

Andrei

  • 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-02T18:33:30+00:00Added an answer on June 2, 2026 at 6:33 pm

    There are at least two and possibly three problems, one of which I’m sure is just debug code:

    1. You’ve told jQuery to use dataType: "application/xml". The dataType argument isn’t a MIME type, it’s a jQuery-specific thing. You want dataType: "xml".

    2. (This is probably the debug thing.) In your success function, you’re passing the XML document into the html function, which will raise an error. If you change it to text instead, it’ll show "[object Document]" instead, which makes sense — jQuery has deserialized the XML into an XML Document object for you.

    3. You’re sending the XML string without encoding it. When you specify a string for the data argument, you are responsible for ensuring it’s properly encoded for transit (reference). I’m fairly sure you need to change the line

      data: xmlString
      

      …to

      data: encodeURIComponent(xmlString)
      

      I say “fairly sure” because I don’t remember the last time I tried to post XML to a server. But anything you’re sending via POST should typically be URL-encoded.

    Live working example | source

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

Sidebar

Related Questions

I am using the php post request example given on http://code.google.com/apis/chart/docs/post_requests.html for generating chart.
How I can deserialize this : [{'fields': {'active': 1, 'image': 'http://img.rasset.ie/0003db75-150.jpg', 'name': 'Bad Fellas',
We have a web site with domain http://209.59.154.150/~phnxaudi/ ,. To develop this website we
UIWebView *webview=[[UIWebView alloc] initWithFrame:CGRectMake(10, 10, 150, 120)]; NSString *media=@http://www.youtube.com/watch?v=kG2BYhjQIKQ; NSString *html = [NSString stringWithFormat:youTubeVideoHTML,media,
http://www.dorsetdesigns.co.uk/contact.html try the form it wont send a email to me. i am using
http://jqueryui.com/demos/accordion/ You can do $('#itename').accordion('activate', 0) to make an accordion closed but that'll change
You can see the code live here: http://jsfiddle.net/z3xV3/50/ My HTML: <div id=slider></div> <input id=sliderValue
I am working on existing project. I have following two URLs http://example.dev/en/course/myUserName/myCourseName/150/myChapterName/1016/page/1/?hcid=147 http://example.dev/en/course/myUserName/myCourseName/150/myChapterName/1016/page/2/?hcid=147 2nd
I've implemented a simple multi-threaded HTTP server for my programming assignment a couple weeks
Can anybody tell me why the default canvas size is 300 x 150 pixels?:

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.