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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:58:37+00:00 2026-05-28T07:58:37+00:00

I have a simple ajax call like this: $.ajax({ url: u, type: POST, dataType:

  • 0

I have a simple ajax call like this:

$.ajax({
       url: u, type: "POST", dataType: "json",
       data: data,
       success: function (d) { response($.map(d, function (o) { return { label: o.Text, value: o.Text, id: o.Id} })); }
});

It is part of an tb autocomplete that does not work on only one view.
The reason it does not work is that instead of json, it makes jsonp request (by sniffing I saw that it calls passed url with ?callback=jQueryxxxxxxxxx), and success function is never called because jquery packs it into anonymous function whose name is passed in callback argument, and server returns standard json (I don’t want to use jsonp as it is POST request and NOT cross-domain request). I checked, both current view url and this u for ajax url argument are on http://localhost:8080/myapp/areax/..., so I don’t see why jQuery makes JSONP request here.

EDIT:

View on which this does not work has url request is made is like this:
http://hostname:8080/AreaName/Report/ViewReport
and u parameter of ajax is like /AreaName/MyAutoComplete/Search, so complete url to which autocomplete is made is like
http://hostname:8080/AreaName/MyAutoComplete/Search?callback=jQuery151013129048690121925_1327065146844

Server’s response looks like this:

[{"Id":2,"Text":"001"},{"Id":7,"Text":"002"}]

I know it is not jsonp, for that it should be

<script>
 jQuery151013129048690121925_1327065146844([{"Id":2,"Text":"001"},{"Id":7,"Text":"002"}]);
</script>

But I want to make normal json request, not jsonp.

UPDATE

Weirdest thing of all (I’m starting to think it is a bug in jQUery v1.5.1 which is used on project) is that when I remove dataType: "json", it makes a normal json request 🙂

So, instead of how to make json request, now I will accept an explanation to why this works as expected (and the one with dataType:”json” does not):

$.ajax({
       url: u, type: "POST",
       data: data,
       success: function (d) { response($.map(d, function (o) { return { label: o.Text, value: o.Text, id: o.Id} })); }
});
  • 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-28T07:58:38+00:00Added an answer on May 28, 2026 at 7:58 am

    From the bug here : http://bugs.jquery.com/ticket/8118

    You are probably using jquery-validation plugin. Jquery-validation plugin is not compatible with jQuery 1.5 and the conflict causes the kind of issue you are having here.

    If the problem is not specifically due to jquery-validation plugin, check if you have any other jquery plugin that might not be compatible with jQuery 1.5

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

Sidebar

Related Questions

I have the following ajax call: $(#welcome a.close).click(function(e) { $.ajax({ type: GET, url: /visitors/hide_welcome,
I have something like this, where it is a simple call to a script
I have a very simple ajax call to refresh some data on my webpage,
I have written a simple jQuery.ajax function which loads a user control from the
I have an ajax form in asp.net mvc which is as simple as this:
I have a simple span like so <span class=action removeAction>Remove</span> This span is within
I made a simple javascript class like this: function Horse() { this.color = 'brown';
this is probably really simple for a jQuery expert. I have <div id="form23"><form><textarea>blahblah</textarea><input type="button"
I have a simple MVC3 Controller Action like this [HttpGet] [OutputCache(Duration = 1200,Location=System.Web.UI.OutputCacheLocation.Server)] public
Friends, I'm lost here. I have this WCF Rest service returning data in json

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.