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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:20:55+00:00 2026-05-26T21:20:55+00:00

what im trying to do is to send data in JSON using jquery to

  • 0

what im trying to do is to send data in JSON using jquery to server and receive it at server side. After that parse it and use the data and again response back to client in json form. Im using Play(web based framework for java) at server side. Here is my code:

Tier.js

var attribs={ 
                id: document.forms["tier"]["id"].value , 
                name: document.forms["tier"]["name"].value ,
                limits: document.forms["tier"]["limits"].value
                };

$.ajax({
        type:"get",
        url: "validateTier.json" ,
        dataType: "json",
        jsonp: 'callback',
        data: attribs,
        contentType: "application/json; charset=utf-8",
        beforeSend: function( xhr ) {
            xhr.overrideMimeType( 'application/json; charset=utf-8' );
          },
        error:function(x,e){
            if(x.status==0){
                alert('You are offline!!\n Please Check Your Network.');
                }else if(x.status==404){
                alert('Requested URL not found.');
                }else if(x.status==500){
                alert('Internel Server Error.');
                }else if(e=='parsererror'){
                alert('Error.\nParsing JSON Request failed.');
                }else if(e=='timeout'){
                alert('Request Time out.');
                }else {
                alert('Unknow Error.\n'+x.responseText);
                }
        },
        success: function(data) {
         alert(data.status);
        },

        }).done(function( msg ) {
              alert( "Data Saved: " + msg );
        }); // End ajax

at Server side:

Map<String,Object> json = new HashMap<String,Object>();
        json.put("status", status);
        json.put("message", msg);
        renderJSON(json);

Output:

You are offline!!
Please Check Your Network.

  • 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-26T21:20:56+00:00Added an answer on May 26, 2026 at 9:20 pm

    It looks to me like you are not actually sending the data to the server as JSON – you appear to just be sending arguments as typical name/value pairs. If your server backend is expecting JSON, that is likely the source of your error.

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

Sidebar

Related Questions

I'm trying to send data from a client application using jQuery to a REST
I am able to send data to the server using JSON and get back
i want to send json to server using Spring 3.x, i use annotation @RequestBody,
I'm trying to send JSON data to a server. RequestBuilder builder = new RequestBuilder(RequestBuilder.POST,
I am trying to use jQuery ajax to send a json object to a
I'm trying to send the node instance JSON data using an ajax get request
I am trying to send data, in json format to my webservice, using POST.
I'm trying to use JQuery to pass a data structure that looks similar to
We are using C#, ASP.NET & WCF. I am trying to send form data
I'm trying to create a TCP connection and send/read data that uses SSL, but

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.