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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:20:58+00:00 2026-05-29T05:20:58+00:00

I am working on a app that makes use of object literals to represent

  • 0

I am working on a app that makes use of object literals to represent groups, topics, and tasks. There is also an object literal that handles command input from the app’s “command-line interface”.

When the user clicks on a topic, the command object sets its obj property to refer to the object that represents what was clicked on. That is: the user clicks a group title, and now command.obj represents the group object.

The function below resides in the command object literal and shows how this.obj is set. It is called when an element is clicked, that element is the obj var passed in to the function:

/* defines taxonomy and obj of clicked element */
set_taxonomy: function(obj){
    if( $(obj).hasClass('group-title') ){
        this.taxonomy = $.trim('group');
        this.obj = group;
        }
    else if($(obj).hasClass('topic-title') ){
        this.taxonomy = $.trim('topic');
        this.obj = topic;
        }
    else if( $(obj).hasClass('task') ){ 
        this.taxonomy = $.trim('task');
        this.obj = task;
        }

    console.log(this.obj);

    this.set_commands();

},

group, topic, and title are object literals that are loaded automatically.
When topics and titles are clicked, console.log(this.obj) prints out object with all the respective properties and functions.

Clicking on a group shows the number 3.

What does the 3 mean?

See example of working topic object : http://pastebin.com/NEmKHdzc

See example of non-working group object : http://pastebin.com/ezPghLbM

  • 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-29T05:20:59+00:00Added an answer on May 29, 2026 at 5:20 am

    Are you sure group is being set properly? Try console.log(group) in the first if statement. If you get 3, I would double-check (with more console.log calls) that you are setting group properly in the first place.

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

Sidebar

Related Questions

I am working on a Rails 3.1 app that makes use of CoffeeScript. As
I'm working on an MVC app that makes heavy use of Services. My question
I have an application that makes use of the App trait, and it's all
I'm working on an Android app that connects to .NET webservices. I use the
I have been working on an object class for my iPhone app that lazy
Im working on an app that now has to go to a URL online
I'm working on an app that works out debts and who owes what to
I'm working on an app that creates an user profile. I need to be
I am working on an app that takes a picture and saves it to
I'm working on an app that does some web scraping. In the sites model,

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.