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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T10:58:01+00:00 2026-05-15T10:58:01+00:00

im trying to POST (cross domain) some data to a jersey web service and

  • 0

im trying to POST (cross domain) some data to a jersey web service and retrieve a response (a GenericEntity object). The post successfully gets mapped to my jersey endpoint however when i pull the parameters from the request they are empty..

$ .ajax({
   type: "POST",
   dataType: "application/json; charset=utf-8",
   url: jerseyNewUserUrl+'?jsoncallback=?',
   data:{'id':id, 'firstname':firstname,'lastname':lastname},
   success: function(data, textStatus) {
   $('#jsonResult').html("some data: " + data.responseMsg);
            },
   error: function ( XMLHttpRequest, textStatus, errorThrown){
    alert('error');
     }
  });

this is my jersey endpoint..

@POST
    @Produces( { "application/x-javascript", MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
    @Path("/new")
    public JSONWithPadding addNewUser(@QueryParam("jsoncallback")
    @DefaultValue("empty")
    final String argJsonCallback, @QueryParam("id")
    final String argID, @QueryParam("firstname")
    final String argFirstName, @QueryParam("lastname")
    final String argLastName)

is there something missing from my $.ajax call?

  • 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-15T10:58:02+00:00Added an answer on May 15, 2026 at 10:58 am

    Try this:

    $ .ajax({
       type: "POST",
       dataType: "jsonp",
       jsonp: "fooCallBackFunction",
       url: jerseyNewUserUrl,
       data:{'id':id, 'firstname':firstname,'lastname':lastname},
       success: function(data, textStatus) {
       $('#jsonResult').html("some data: " + data.responseMsg);
                },
       error: function ( XMLHttpRequest, textStatus, errorThrown){
        alert('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 do a cross domain POST request and have hit a wall
I'm trying to do a cross domain ajax post request within ie. Here is
I'm trying to post a JavaScript data object with the following: $.post(frm.attr(action), data, function(res)
I'm trying to POST some multipart form data to my server using a Browser
I am trying to post a cross-domain HTTP request but keep getting a SecurityException
I am trying to make a cross domain HTTP request to WCF service (that
I'm currently trying to make some ajax post between cross-domains by following this tutorial
I'm trying to POST a http request using ajax, but getting a response from
I am trying to make cross-domain requests with Safari on Windows. My Safari version
I am trying to connect to a .asmx webservice (cross domain) by means of

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.