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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:55:05+00:00 2026-06-17T23:55:05+00:00

$(document).ready(function(){ $(‘#id1’).click(function(){ $.ajax({ type:GET, url: ggs.erm.servlet.setup5.Page, success:function(response){ var obj = JSON.parse(response); alert(obj); } });

  • 0
$(document).ready(function(){
    $('#id1').click(function(){

        $.ajax({
            type:"GET",
            url:" ggs.erm.servlet.setup5.Page",
            success:function(response){
                var obj = JSON.parse(response);
                alert(obj);
            }
        });
    });
});

I am facing problem with parsing JSON object i receive from server.

Connection con = null;
JSONObject json = new JSONObject();
JSONArray jarray = new JSONArray();
try{
    con =ConnectionPool.getConnection();
    String sql = "select country from country_name";
    Statement stmt = con.createStatement();
    ResultSet rs =  stmt.executeQuery(sql);
    while(rs.next())
    {
        jarray.put(rs.getString(1));    
    }
    json.put("country", jarray);
}
catch(Exception e){e.printStackTrace();}
finally{
    try {
        con.close();
    } catch (SQLException e) {
    e.printStackTrace();}
    }
    response.setContentType("application/json");
    try {
        response.getWriter().write(json.toString());
    } catch (IOException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }
}

This is code for generating json.
Problem is How to parse the JSON object I get on Client Side.

  • 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-17T23:55:07+00:00Added an answer on June 17, 2026 at 11:55 pm

    Don’t use alert() to debug. It just gives you the toString() value, which is [object Object].

    Instead, log the object to the console.

    console.log(response);
    
    // or
    
    var obj = JSON.parse(response);
    console.log(obj);
    

    Open the developer tools in your browser to view the content of the object.

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

Sidebar

Related Questions

$(document).ready(function(){ var var_name=null; $('#id1').click(function(){ $.ajax({ type:GET, url: ggs.erm.servlet.setup5.Page, success:function(response){ var_name=response; console.log(response); } }) });
$(document).ready(function() { $(".addtophundredwatchlist").click(function() { $.ajax({ type : "GET", url : "/watchlisttophundred/", success : function(data){
$(document).ready(function() { $(button).click(getir); }); function getir() { $.ajax({ dataType: json, url:get.php, success: function(datacall) {
$(document).ready(function() { $(#ddlprod).change(function() { var pk= $(#ddlprod).val(); $.ajax({ url: ajaxprintdropdown.php, type: POST, data: 'pk='+pk,
$(document).ready(function() { $('#somebutton').click(function() { $.get('List', function(responseJson) { $.each(responseJson, function(index, item) { var elem=$('<input type=checkbox
$(document).ready(function() { $('#content').html(''); $.ajax({ url:'data.json', dataType: json, success: function(data) { $('#content').append('<p>'+data.rank+'</p>'); } });}); In
$(document).ready(function(){ $('.choices a img').click(function(e) { var url = $(this).attr('href') + ' .con_cen2'; $('.con_cen').html('loading...').load('signup.html'); e.preventDefault();
$(document).ready(function(){ jQuery(#list2).jqGrid({ //url:server.json, datatype:'local', //mtype:'GET', colNames:['Inv No','Date', 'Client', 'Amount','Tax','Total','Notes'], colModel:[ {name:'id',index:'id', width:55}, {name:'invdate',index:'invdate', width:90},
$(document).ready(function() { $('#chkRFI').click( function() { $(INPUT[type='checkbox']).attr('checked', $('#chkRFI').is(':checked')); }); }); <div class=grid_3> <div class=box> <div
$(document).ready(function() { $(.po).click(function(){ var po = $(this).text(); var dataString = 'po='+ po; $.ajax ({

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.