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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T20:01:52+00:00 2026-06-15T20:01:52+00:00

I’m writing a small JavaScript framework for fun and possible implementation similar to backbone(hence

  • 0

I’m writing a small JavaScript framework for fun and possible implementation similar to backbone(hence the tag). I’ve started saving elements as object properties, as shown below. I’m not sure if I’ve seen this done, so I was curious if this causes any issues.

Similarly, If the module depends on other modules I list those at the top of the object in the form of….another object.

I wanted a way to list dependencies ( page elements or JavaScript modules ) and detect any issues up front. This has similar ( not same ) benefits as dependency injection.

This is a specific question on this code review post which explains a bit further on how the framework works.

/*MUserTry
**
**
**         
*/
$A.modelAjax({
    Name:       'MUserTry',
    S:          {
                    DynSma: SDynSma,
                    DynTwe: SDynTwe,
                    DynArc: SDynArc,
                    AniFlipPage: SAniFlipPage,
                    ClientStorage: SClientStorage
                },
    E:          {
                    but: $A('#ut_but')[0]
                },
    J:          {
                    box: $('#ut_box')
                },
    init: function () {
        var pipe = {}, 
            this_hold = this;
        this.J.box.draggable();
        this.E.but.addEventListener("click", function () {
            pipe = $A.definePipe(this_hold.Name);
            $A.ajaxMachine(pipe);
        }, false);
    },
    pre: function (pipe) {
        pipe.page.email = this.e_button.getAttribute('data-email');
        pipe.proceed = true;
    },
    post: function (pipe) {
        this.S.ClientStorage.setAll(pipe.server.smalls);
        this.S.DynSma.run(pipe.server.smalls);
        this.S.DynArc.run(pipe.server.arcmarks);
        this.S.DynTwe.run(pipe.server.tweets);
        this.S.AniFlipPage.run('ma');
    },
    finish: function (pipe) {
        $A.log(pipe);
    }
});
  • 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-15T20:01:55+00:00Added an answer on June 15, 2026 at 8:01 pm

    Ok first off let me offer the obligatory “you’ll never get a better wheel by re-inventing the wheel” warning. Whatever you’re trying to accomplish, you’re almost certainly going to be more successful with it if you use an existing library. And even if there is good cause for you to make your own, it would still benefit you immensely to at least look at existing libraries.

    But … maybe you’re just having fun with this project, and looking at other projects isn’t fun so you’re not doing it. Fair enough.

    In any case, if you do look at Backbone, you’ll find that this practice is core to the Backbone View class. Every View in Backbone has an “el” and “$el” property, which refer to the raw DOM element for the view and the jQuery-wrapped version of that element.

    Backbone has no real performance issues with this because variables/properties in JS are just pointers; in other words, when you set the property of an object to an element, you aren’t duplicating that element, you’re just adding a reference to it (to put it another way, it’s more like you’re an A tag rather than a whole new document).

    The one time Backbone does have a problem though (and your framework will too) is with stale references. In other words, if you just remove element X from the page, the browser will stop using memory for it (eventually, via garbage collection). But if there is an object out there which points to that element, it won’t get garbage-collected, because anything with a reference isn’t “garbage”.

    So, the main thing you have to watch out for is making sure that these objects either:

    A) get deleted whenever their elements do, or

    B) get rid of their references (eg. delete obj.reference) when their elements get deleted

    If you don’t do that, things will still probably work just fine … until you use it on a page with lots of elements being created/deleted, at which point Firefox will start popping up “this script took way too long to run, are you really sure you want to be doing this?” messages.

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

Sidebar

Related Questions

I used javascript for loading a picture on my website depending on which small
I have a small JavaScript validation script that validates inputs based on Regex. I
Is it possible to replace javascript w/ HTML if JavaScript is not enabled on
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want use html5's new tag to play a wav file (currently only supported
In my XML file chapters tag has more chapter tag.i need to display chapters
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have an array which has BIG numbers and small numbers in it. I
I have a text area in my form which accepts all possible characters from

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.