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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:58:38+00:00 2026-06-17T05:58:38+00:00

I have this jsfiddle which uses toggle event – not to be confued with

  • 0

I have this jsfiddle

which uses toggle event – not to be confued with toggle – jQuery version set to EDGE

It suddenly stopped working and removed the cell I wanted as a trigger, since it obviously reverts to toggle.

I cannot find any deprecation tags or such

http://api.jquery.com/category/deprecated/ gives a 404

If I add the Migrate module my jsFiddle then works and I see the warning in the console (elaborated by https://github.com/jquery/jquery-migrate/blob/master/warnings.md as posted by Frédéric Hamidi)

I see Deprecate fn toggle and issue 24 and Ticket #11786 but not in places I would expect to see it.

What am I missing and where do I find the replacement and documentation for it?

NOTE: I understand the reason for deprecation, I just can’t find official documentation for the deprecation

$('#tbl .xx').toggle(
  function() {
    $(this).siblings().each(function(){
      var t = $(this).text();
      $(this).html($('<input />',{'value' : t}));
    });
  },
  function() {
    $(this).siblings().each(function(){
      var inp = $(this).find('input');
      if (inp.length){
        $(this).text(inp.val());
      }
    });
  }    
);

Code in MIGRATE:

jQuery.fn.toggle = function( fn, fn2 ) {
  // Don't mess with animation or css toggles
  if ( !jQuery.isFunction( fn ) || !jQuery.isFunction( fn2 ) ) {
    return oldToggle.apply( this, arguments );
  }
  migrateWarn("jQuery.fn.toggle(handler, handler...) is deprecated");
  // Save reference to arguments for access in closure
  var args = arguments,
  guid = fn.guid || jQuery.guid++,
  i = 0,
  toggler = function( event ) {
    // Figure out which function to execute
    var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
    jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
    // Make sure that clicks stop
    event.preventDefault();
    // and execute the function
    return args[ lastToggle ].apply( this, arguments ) || false;
  };
  // link all the functions, so any of them can unbind this click handler
  toggler.guid = guid;
  while ( i < args.length ) {
    args[ i++ ].guid = guid;
  }
  return this.click( toggler );
};

UPDATE I have asked if they could keep the code as fn.toggler so it is a rename instead of a remove

  • 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-06-17T05:58:39+00:00Added an answer on June 17, 2026 at 5:58 am

    You can find official documentation about toggle()‘s deprecation in the list of warnings emitted by the jQuery Migrate plugin:

    JQMIGRATE: jQuery.fn.toggle(handler, handler…) is deprecated

    Cause: There are two completely different meanings for the .toggle()
    method. The use of .toggle() to show or hide elements is not affected.
    The use of .toggle() as a specialized click handler was deprecated in
    1.8 and removed in 1.9.

    Solution: Rewrite the code that depends on $().toggle(), use the
    minified production version of the jQuery Migrate plugin to provide
    the functionality, or extract the $().toggle() method from the
    plugin’s source and use it in the application.

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

Sidebar

Related Questions

I have created a fiddle to test this : http://jsfiddle.net/Ninjanoel/X6ShS/ which works fine :(
I have this jsfiddle which works once. function toggle_off(itemID){ alert(itemID+'->'+document.getElementById(itemID).getAttribute(style)); document.getElementById(itemID).style.display = 'none'; }
Possible Duplicate: Set Additional Data to highcharts series So I have this graph: http://jsfiddle.net/Gg3ZL/
I have this code which is looking for an onchange event: //Create destination switch
I found this tutorial which uses jQuery and validation plugin to validate form input.
I have this JSFiddle which explains my problem. I want the menu items along
I have a set of headers and sections in an HTML5 file which uses
I have this jsfiddle . When I move the script from the upper panel
I have this fiddle: http://jsfiddle.net/yub2B/4/ HTML: <input type=text /> <input type=text /> <input type=text
I have this fiddle : http://jsfiddle.net/XjeCf/1/ that works like I want and this one

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.