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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:50:16+00:00 2026-05-26T14:50:16+00:00

I have the following JQuery code in an attempt to populate a dropdown list:

  • 0

I have the following JQuery code in an attempt to populate a dropdown list:

<script language="javascript" type="text/javascript">
$(function(){
    $("#setStatusDrpDown").change(function(){
    $.getJSON("getStatusChangeReasons", 
              {selectedStatusId: $(this).val(), ajax: 'true'}, 
               function(result) {
              alert("here");
              for (var i = 0; i < result.length; i++) {
              alert("hello");
              options += '<option value="' + result[i].id + '">' + result[i].changeReason + '</option>';
  }
              $("select#statusChangeReason").html(options);
        });
      });
    });
</script>

I know that the code is running because I can see my controler intercept it and even print the selectedStatusId value. What I cannot figure out is why neither of my alerts are displayed. I don’t see any errors on the javascript console. Its as if code simply quits execution after the controller. Any advice is apprecaited!

  • 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-26T14:50:17+00:00Added an answer on May 26, 2026 at 2:50 pm

    Your service might be throwing an error or returning something that $.getJSON can’t understand.

    Important: As of jQuery 1.4, if the JSON file contains a syntax error,
    the request will usually fail silently. Avoid frequent hand-editing of
    JSON data for this reason. JSON is a data-interchange format with
    syntax rules that are stricter than those of JavaScript’s object
    literal notation. For example, all strings represented in JSON,
    whether they are properties or values, must be enclosed in
    double-quotes. For details on the JSON format, see http://json.org/.

    http://api.jquery.com/jQuery.getJSON/

    You can handle the error withe xhr return value.

    // Assign handlers immediately after making the request,
    // and remember the jqxhr object for this request
    var jqxhr = $.getJSON("example.json", function() {
      alert("success");
    })
    .success(function() { alert("second success"); })
    .error(function() { alert("error"); })
    .complete(function() { alert("complete"); });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following jquery-code: <script type=text/javascript> $(document).ready(function() { $ ('ul.image-list li:even').addClass ('even'); $
I have following jQuery/JS code <script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js></script> <script> $.getJSON(http://example/topics, {}, function(data){ console.log( data
I have problems with the following bit of javascript/jquery code: this.droppable = function(){ $('.imageWindow
I have the following jQuery code $(#dropdown).hover(function() { $(this).stop(true,true).fadeTo('fast',1); $(#options).stop(true,true).slideDown(); }, function() { $(this).delay(1000).stop(true,true).fadeTo('fast',0.1);
I have the following css and jquery code to attempt to change the text
I have the following jQuery code: <script> function hideMenteeQuestions() { $(#menteeapp).hide(); $(textarea[name='short_term_goals']).rules(remove, required); $(textarea[name='long_term_goals']).rules(remove,
I have the following jquery code: jQuery(function(){ jQuery(select#rooms).change(function(){ var options = ''; jQuery.getJSON(/admin/selection.php,{id: jQuery(this).val(),
I am having a link <a id=test href=text.php>test</a> I have the following jquery code
i have the following jquery code to format a html table. $(.jtable td).each(function() {
I have the following JQuery code: $(this).text('Options &#x25B4;'); However, the ascii code isn't showing

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.