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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:42:54+00:00 2026-06-15T10:42:54+00:00

I am trying to send a json object to a servlet . but it

  • 0

I am trying to send a json object to a servlet .

but it is showing error like this:
XMLHttpRequest cannot load http: //192.168.10.113:8080/collective-intellegence/SaveFeedback. Origin http: //192.168.9.185 is not allowed by Access-Control-Allow-Origin

My Code

var feedbackData = [];

        for (j in storeData.collection) {
            var fromData="abc";
            feedbackData.push({
                "queryid": queryId,
                "from": fromData,
                "to": GetUserDetails(storeData.item(j)),
                "isresolved": document.getElementById(("chk" + j)).checked
            });
        }
$.ajax({
                type: 'POST',
                url: saveDataURL,
                data: "{ 'feedback': '" + feedbackData + "' }",
                dataType: 'json',
                success: function (data) {
                    alert('Success');
                },
                error: function () {
                    alert('Error');
                }
            });

This is showing ERROR

i Googled and found that we can’t pass json object to a cross domain.

so i decided to create a jsonp object which i can pass to cross domain .

please help to solve the problem

thanks in advance

  • 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-15T10:42:55+00:00Added an answer on June 15, 2026 at 10:42 am

    You have to change the Datatype to JSONP

    function hello(data){ // my call back function
                console.log(data);
            }
    
            $(function(){
                //It's not actually working, but htis code should work well
                //Let's say that you put your docStats in an object
                //like docStats = data.response.clickStats.docStats
    
                $.ajax({
                    url:'http://example.com',
                    type : 'POST' ,
                    dataType: 'jsonp',
                    data : {
                        fq: 'param1',
                        wt: 'param2',
                        "json.wrf" : 'hello' // how i call my callback function
    
                    }
                });
    
            })
    
    • 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 json object to server. But I received an error and
I am trying to send JSON object as parameter. localhost:8080/HelloWorldApplication/webresources/helloworld/get/{param} During this process I
I am trying to send JSON data from a form using the XMLHttpRequest object.
I'm trying to send an XMLHttpRequest object to my Rails server but the headers
I'm trying to send JSON-object form MongoDB to page with ejs template engine. Here's
I am trying to use jQuery ajax to send a json object to a
I am trying to send a serialized object using JSON. Here is my view
I am trying to use the http GET method to retrieve JSON object I
I'm trying to send a JSON object from an AJAX request to my server.
Happy coding weekend to everyone!!!. I'm stuck trying to send a JSON object via

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.