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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:13:12+00:00 2026-06-08T11:13:12+00:00

I am making a sort of tabbed interface for a Tiddlywiki, and I am

  • 0

I am making a sort of tabbed interface for a Tiddlywiki, and I am wondering how to get this code to fire every time a tiddler is opened or closed. Tiddlywiki is an HTML notebook type of thing that runs in the browser, and a tiddler is a div in #tiddlerDisplay. There can be, and usually are, more than one in it at a time.

The divs I want to list are contained in #tiddlerDisplay, and the list itself is jQuery("#mainMenu > #singleTiddlerList").

config.macros.singleTiddler.update = function(){
    jQuery("#mainMenu > #singleTiddlerList").empty();
    jQuery("#tiddlerDisplay > div").each(function(i,e){
        jQuery("#mainMenu > #singleTiddlerList").append(jQuery(
            createTiddlyButton(document.createElement("li"),jQuery(e).attr("tiddler"),"",config.macros.singleTiddler.clickHandler)
        ).parent());
    });
};

Update: I can’t just add a custom event, unless I can do it from outside the current code (such as something that fires on document load).

  • 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-08T11:13:13+00:00Added an answer on June 8, 2026 at 11:13 am

    One way is jQuery("#tiddlerDisplay").bind("DOMSubtreeModified", config.macros.singleTiddler.update);, however i think this only works in Chrome (maybe Opera or Safari, not sure), and also appears to be deprecated. Firefox has a duo of events to accomplish the same thing, but i think these are also deprecated.

    Another way I found after reading this article and exploring the TiddlyWiki source code is this:

    (function( $, oldRem ){
        Story.prototype.displayTiddler = function(){
            var resp = oldRem.apply( this, arguments );
            $("#tiddlerDisplay").trigger("displayTiddler");
            return(resp);
        };
    })( jQuery, Story.prototype.displayTiddler );
    (function( $, oldRem ){
        Story.prototype.closeTiddler = function(){
            var resp = oldRem.apply( this, arguments );
            $("#tiddlerDisplay").trigger("closeTiddler");
            return(resp);
        };
    })( jQuery, Story.prototype.closeTiddler );
    jQuery("#tiddlerDisplay").bind("displayTiddler", config.macros.singleTiddler.update);
    jQuery("#tiddlerDisplay").bind("closeTiddler", config.macros.singleTiddler.update);
    

    Notice that the event fires after the tiddler opens or closes. Also, as the article states, jQuery can be bugged in the same way, but I don’t know about the native DOM methods, and I kind of doubt it. There’s supposed to be an event for it, but regardless, everyone should totally drop them and use jQuery!

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

Sidebar

Related Questions

Possible Duplicate: How to sort the results of this code? Im making a search
Currently I'm making sort of SQL command line interface for web-based application. It should
I'm using a NSSortDescriptor to sort my tableView but this line is making trouble:
I am making some sort of form with many input fields (some are textfields,
I am making some sort of turn-based battle system in a JFrame where the
I am interested in making some sort of HTML page that displays the name
I want to perform a sort operation on some field. Is it advantageous making
I'm making a sort of Webserver that enables a user to give .jow file
I'm making a sort elements web game using jQuery, HTML & CSS. While everything
I have a feeling I am making some sort of foolish mistake here, however

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.