title: sending JSON to server using JQuery but throwing error while receiving it
body: <p>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:</p>
  
  <p>Tier.js</p>
  
  <pre><code>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
  </code></pre>
  
  <p>at Server side:</p>
  
  <pre><code>Map&lt;String,Object&gt; json = new HashMap&lt;String,Object&gt;();
          json.put("status", status);
          json.put("message", msg);
          renderJSON(json);
  </code></pre>
  
  <p>Output:</p>
  
  <p>You are offline!! 
  Please Check Your Network.</p>