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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:31:30+00:00 2026-06-15T03:31:30+00:00

var httpc = new XMLHttpRequest(); // simplified for clarity httpc.open(POST, url, true); // sending

  • 0
var httpc = new XMLHttpRequest(); // simplified for clarity
        httpc.open("POST", url, true); // sending as POST
        httpc.setRequestHeader("Content-Type",
                "application/x-www-form-urlencoded");
        httpc.onreadystatechange = function() { // Call a function when the
            // state changes.
            if (httpc.readyState == 4 && httpc.status == 200) {
            //MY JSON RESPONSE  
                        alert(JSON.stringify(httpc.responseText));
            }
        }
        httpc.send(params);

The above code is working fine in android 4.0 and response is getting in valid JSON format..
but when i run the same code in android 2.3 i’m getting response in unknown format and my url and params are same for both android versions.

in 2.3 my response is .
�I�%&/m�{J�J��t��$ؐ@�����iG#)�*��eVe]f@�흼��{���{��;�N’���?\fdl��J�ɞ!���?~|?”��?�YQ~�裏F�������n���/����ț&����2���u�~����)`�U��TH��2Ϛ<}S_��Y��z:%�����,�o�e��tv��X��E��{?v��U��V�j�B�s�FU�~�p�Զ�ɢ�i�2[^�i�S��W���_���’������

in 4.0 my response is
[{“email”:””,”password”:””,”user_id”:””,”store_id”:””,”message”:”Alert!, Wrong Email or Password Please Try Again.”,”success”:”0″,”nick_name”:””,”magazine_genre_id”:””,”magazine_genre_name”:””,”newspaper_genre_id”:””,”newspaper_genre_name”:””,”old_password”:””,”new_password”:””,”mode”:””,”languagecode”:””,”URL”:””}] at file:///android_asset/www/project.js:717

Logcat exception: SyntaxError: Parse error at undefined:1

  • 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-15T03:31:31+00:00Added an answer on June 15, 2026 at 3:31 am

    Have you tried setting the responseType to json. I have only used it from jquery. If you have any doubt check this XMLHttpRequest

    Answer
    There are some alternatives provided in this SO post JSON Parsing works on Android 4.0 but not on Android < 4.0

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

Sidebar

Related Questions

currently i using this code in phonegap application var xmlhttp = new XMLHttpRequest(); xmlhttp.open(GET,http://192.168.1.19:8080/searchMobile?categoryRequest=true,
When I post the following to node (simplified example): var xhr = new XMLHttpRequest();
My flash code: var request=new URLRequest('http://localhost/test.php'); request.method = URLRequestMethod.POST; var data = new URLVariables();
Iam trying to encode url of the xmlhttprequest method as utf-8 var Url=(http://localhost/day1/tryconnect.php?add=+address) ;
I have this code: <script type=text/javascript> var url = http://www.xxxxx.xxx/xxxxxxxxx; var txt; var id1;
var ref1 = new Firebase(http://gamma.firebase.com/myuser/123,456); ref1.set(123,456); var on1 = ref1.on(value, function(snapshot) { console.log(snapshot.val()); });
function getWindowsUserName() { var WinNetwork = new ActiveXObject(WScript.Network); var urlToSite = http://localhost/index.php?nph-psf=0&HOSTID=AD&ALIAS= + WinNetwork.UserName;
I have a System.Uri, e.g., var uri = new Uri(http://www.domain.com/foo/bar); How do I get
containerBuilder .Register<IGraphClient>(context => { var graphClient = new GraphClient(new Uri(http://localhost:9999/db/data)); graphClient.Connect(); // Particularly this
var request = new WebClient(); request.DownloadFile(http://2nditeration.ca/Images/facebook.png, C:\tmp\filename.png); The first parameter is saying there are

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.