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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T16:29:57+00:00 2026-05-19T16:29:57+00:00

I am trying the new jQuery 1.5 and it broke a few things in

  • 0

I am trying the new jQuery 1.5 and it broke a few things in my application. I make a call to an action that generates the JSON, but something errors out and causes the script to stop. According to Fiddler and Firebug, the action does return JSON data. I didn’t provide the JSON data, but the data is valid according to JSONLint.

Please note that this works as expected in jQuery 1.4.4.

The first thing I noticed was the URL: http://localhost:3219/News/GetAllNewsArchives?callback=jQuery15033185029088076134_1296751219270&_=1296751219672

Script:

// Dropdown box for past articles
$("#article-select").ready(function() {
    $.ajaxSetup({ cache: false });
    $.getJSON('/News/GetAllNewsArchives', null, function(json) {
        var items = "<option value=''>(Select)</option>";
        $.each(json, function(i, item) {
            items += "<option value='" + item.Id + "'>" + subject + "</option>";
        });
        $("#article-select").html(items);
    });
});

Action:

    public ActionResult GetAllNewsArchives()
    {
        return Json(newsRepository.GetAllNewsArchives(), JsonRequestBehavior.AllowGet);
    }

Any ideas of what I am doing wrong?

  • 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-19T16:29:57+00:00Added an answer on May 19, 2026 at 4:29 pm

    Okay, I switched to a $.ajax call and I had the same error:

    // Dropdown box for past articles
    $("#article-select").ready(function() {
        $.ajax({
            cache: false,
            type: "POST",
            dataType: "json",
            url: "/News/GetAllNewsArchives",
            success: function(json) {
                var items = "<option value=''>(Select)</option>";
                $.each(json, function(i, item) {
                    items += "<option value='" + item.Id + "'>" + subject + "</option>";
                });
                $("#article-select").html(items);
            }
        });
    

    However, I noticed something on the $.ajax() documentation.

    As of jQuery 1.5, jQuery can convert a dataType from what it received in the Content-Type header to what you require. For example, if you want a text response to be treated as XML, use “text xml” for the dataType. You can also make a JSONP request, have it received as text, and interpreted by jQuery as XML: “jsonp text xml.” Similarly, a shorthand string such as “jsonp xml” will first attempt to convert from jsonp to xml, and, failing that, convert from jsonp to text, and then from text to xml.

    I changed my data type from dataType: "json" to dataType: "text json" then it worked.

    Now, I just don’t understand why the difference. What does json expect that is different?

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

Sidebar

Related Questions

I fairly new to JQuery and perhaps trying to achieve something that might be
I'm new to Jquery and trying to make a http request so that I
Relatively new to jquery. I'm trying to make a button like the accordion button...something
new to jquery here but I'm trying to learn some different stuff that's been
I'm trying the new data-function in jQuery but can't make it work. Here is
I've been trying to use the new jquery-ui, and all but the resizable function
I'm rather new to jQuery and I'm trying to make a cool little menu
I'm new to jquery and i'm trying to make a dropdown menu list like
I'm new to jquery and trying to accomplish something. My HTML looks like: <li>
I'm new to jQuery and I'm trying to work a solution that will be

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.