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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T19:25:01+00:00 2026-05-29T19:25:01+00:00

Possible Duplicate: DOM Mutation event in JQuery or vanilla Javascript I am using backbone.js

  • 0

Possible Duplicate:
DOM Mutation event in JQuery or vanilla Javascript

I am using backbone.js with dynamically generated templates and I am using several jQuery UI plugins, which attach to some classes, like slimScroll:

$(function(){
    $('.scroll').slimScroll({
        height: $(window).height();
    });

    $('.stars').changeSelectBoxToRatingStars();
    // ...
});

When I update the DOM tree (by rendering a template, loading new content, …) and there are new elements added, these bindings need to be refreshed.

There are DOM Tree mutation events, which are now deprecated and not supported by IE (See DOM mutation events replacement). I have also seen .live() in jQuery, which makes it possible to update .click() an similar events, but it can’t monitor the DOM for changes. Any suggestions for an efficient, standards-compliant way to monitor DOM tree changes in every browser?

  • 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-29T19:25:03+00:00Added an answer on May 29, 2026 at 7:25 pm

    I’ve finally managed to find a solution myself. As @Šime Vidas suggested in his comment, I am now handling the UI updates directly when needed. This is, when new stuff is rendered (in MainRouter#show)

    class MainRouter extends Backbone.Router
      # [...]
      show: (id) ->
        item = Items.get(id)
    
        # Render item
        @view = new ShowView(model: item)
        $(".content").html(@view.render().el)
    
        # Update scrolling and UI items
        window.updateUI()
    

    and on when the window is resized:

    window.$(window).resize -> window.updateUI()
    

    The window.updateUI() method itself does nothing fancy. It just adds slimScroll scrollbars where necessary and updates some divs, when the window is resized.

    Thank you all for your help!

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

Sidebar

Related Questions

Possible Duplicate: Prevent click event from affecting parent jquery I have a DOM structure
Possible Duplicate: Inspect attached event handlers for any DOM element Is there a tool
Possible Duplicate: Javascript: How to loop through ALL DOM elements on a page? var
Possible Duplicate: How to extract a node attribute from XML using PHP's DOM Parser
Possible Duplicate: JQuery to check for duplicate ids in a DOM Suppose i have
Possible Duplicate: Trigger an event with Prototype example, 3 onclick events in javascript/prototype. How
Possible Duplicate: What does this JavaScript/jQuery syntax mean? I specifically mean when you do
Possible Duplicate: A good Javascript API reference documentation related to browsers and DOM I've
Possible Duplicate: How to get a DOM Element from a JQuery Selector I can
Possible Duplicate: JavaScript setAttribute vs .attribute= javascript dom, how to handle "special properties" as

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.