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

  • Home
  • SEARCH
  • 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 7059445
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:13:59+00:00 2026-05-28T04:13:59+00:00

This following code snippet works fine using jQuery1.2.3, but it doesn’t work with latest

  • 0

This following code snippet works fine using jQuery1.2.3, but it doesn’t work with latest version of jQuery:

$.getJSON(url,{str: $$.val() }, function(j){
   if (j.length > 0) {
      var options = '<option value="">' +params.firstOption+ '</option>';
      for (var i = 0; i < j.length; i++) {
         options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>';
      }
   }
   $dest.removeAttr('disabled')
        .html(options)
        .find('option:first')
        .attr('selected', 'selected');
});

Please note that this above code is actually part of a jQuery plugin for cascading drop down list. It produces desired result if I use jQuery1.2.3. The full plugin code is as follows:

(function($){

   $.fn.linkedSelect = function(url,destination,params) {


       var params = $.extend({

         firstOption : 'Please Select',

         loadingText : 'Loading...'

      },params);

      var $dest = $(destination);

      return this.each(function(){

         $(this).bind('change', function() {

            var $$ = $(this);

            $dest.attr('disabled','false')
                 .append('<option value="">' +params.loadingText+ '</option>')
                 .ajaxStart(function(){

                    $$.show();

            });

            $.getJSON(url,{str: $$.val() }, function(j){
               alert('User clicked on this.'); 
               if (j.length > 0) {

                  var options = '<option value="">' +params.firstOption+ '</option>';

                  for (var i = 0; i < j.length; i++) {

                     options += '<option value="' + j[i].optionValue + '">' + j[i].optionDisplay + '</option>';

                  }

               }

               $dest.removeAttr('disabled')
                    .html(options)
                    .find('option:first')
                    .attr('selected', 'selected');

            }); // end getJSON

         });  // end change

      }); // end return each

   };  // end function

})(jQuery);

Please note that it can’t generate the following alert message

alert('User clicked on this.');

what is written inside the getJSON function for debugging purpose if I use latest version of jQuery. And I have also traced using JS debugger, it can’t step into the getJSON function if I use latest version of jQuery. But, it shows this alert message if I use jQuery1.2.3.

In error console, warning messages are:

Warning: reference to undefined property b.p.height
Source File: http://localhost//js/jquery.jqGrid.min.js Line: 99
Warning: reference to undefined property b.p.serializeGridData
Source File: http://localhost/js/jquery.jqGrid.min.js Line: 62
Warning: reference to undefined property jQuery.event.triggered
Source File: http://localhost/js/jquery1.7.js Line: 2924
Warning: reference to undefined property elem[jQuery.expando]
Source File: http://localhost/js/jquery1.7.js Line: 1719

What should I change to adapt with latest version of jQuery. Thank you.

  • 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-28T04:13:59+00:00Added an answer on May 28, 2026 at 4:13 am

    Most likely your server is producing invalid JSON.

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

Sidebar

Related Questions

i am using the following code snippet to backup/restore database Backup works fine but
I am creating a repeating alarm. This works fine using the following code: Intent
Never thought I'd have this problem :) The following snippet of code works in
I have the following code snippet: using (SPSite site = new SPSite(this.ListAddress)) { using
The following code doesn't work! 'this' in in the context when i access it
The following code snippet works fine for CSV file sizes larger than 10 K.
From this site: http://www.toymaker.info/Games/html/vertex_shaders.html We have the following code snippet: // transformations provided by
I'm pulling data from Dynamics AX 2009 from c# using the following code snippet.
This following code gets this compile error: " invalid types 'int[int]' for array subscript
Did I not get enough sleep or what? This following code var frame=document.getElementById(viewer); frame.width=100;

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.