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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:10:42+00:00 2026-05-18T08:10:42+00:00

I recently upgraded our project’s jQuery file from 1.4.2 to 1.4.4 and it appears

  • 0

I recently upgraded our project’s jQuery file from 1.4.2 to 1.4.4 and it appears that as of 1.4.3 the way we have been using jQuery.data has stopped working.

We have this code:

var events = $(window).data('events');

if (events.scroll)
if (!events.scroll.include(handler))
  $(window).scroll(handler);

the purpose is to prevent this particular handler from being bound multiple times.

In 1.4.2, this works fine. In 1.4.4, events is undefined.

function handler() {
  //do something
}

$(document).ready(function(){
  $(window).scroll(handler);
  $('div#test').scroll(handler);

  $(window).data('events') -> undefined
  $('div#test').data('events') -> Object
});

What changed with this API? How should I list events for window?


I have changed the first line to this:

var events = $(window).data('__events__').events;

a bit messy-looking, but the ability to wire events to plain objects is compelling.

  • 1 1 Answer
  • 1 View
  • 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-18T08:10:42+00:00Added an answer on May 18, 2026 at 8:10 am

    There was a change in jQuery 1.4.3+ for event types, to avoid object name collisions, for window (or any other plain object) use the key "__events__" instead, like this:

    var events = $(window).data('__events__');
    

    The same __events__ key is used for any objects that don’t have a .nodeType property (which window doesn’t, so it’s treated like a plain object here).


    To be clear that this was a conscious, intentional change, it’s included in the jQuery 1.4.3 release notes:

    JavaScript Objects
    A number of changes were made to when .data() is used on JavaScript objects (or, more accurately, anything that isn’t a DOM node). To start whenever you set data on a JavaScript object the data is set directly on the object – instead of going into the internal data object store. Additionally events that are attached to objects are put in a new __events__ property that is actually a function. This was done to allow events to be attached directly to an object, be garbage collected when the object is collected, and not be serialized by a JSON serializer. These changes should make jQuery’s data and event systems much more useful on JavaScript objects.

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

Sidebar

Related Questions

We are using jquery validation plugin in our project. Recently we have upgraded our
We've recently upgraded one of our SSRS2005 servers to SSRS2008 and have found that
Our dev server was recently upgraded to PHP v5.2.13. With that upgrade we have
I recently upgraded from jQuery 1.2.6 to 1.3.2 Now on the page I'm using
We just recently upgraded from VS2008 to VS2010. Our project compiles fine; but when
All: We are using Visual Studio 2010, and we have recently upgraded our workstations
my company has recently upgraded from VS2005 to VS2010. We have a huge project
We have recently upgraded from mvc2 to mvc3 and one of our Custom Authorization
I have recently upgraded from CruiseControl .Net 1.4.3.x on our build machine to the
All - I have recently upgraded our production environment from Sql Server Reporting Services

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.