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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T05:49:13+00:00 2026-06-16T05:49:13+00:00

I have a js file named bars.js. This javascript file contains the code to

  • 0

I have a js file named bars.js. This javascript file contains the code to display the outer structure of the page. So when I do $(‘#mainContainer’).drawBar(); (drawBar() is a function inside the Bars.js) it will draw the outside structure of my page. Now, I am using backbone.js. In the app.js I am calling the $(‘#mainContainer’).drawBar();

So drawBar() function has <table><tr class='rows_table'><td> ABC</td><td>DEF</td></tr></table> (this code resides in the bar.js)

So this will append to my ‘mainContainer’.

So now, my question is, from app.js I am not able to refer the elements like :
this.$(‘.rows_table’).css(“display”,”block”);

rather I have to call it
$(‘.rows_table’).css(“display”,”block”);. Is there a way I can bring this bar.js code in “this.$” reference?

Can i call it this.$(‘.rows_table’)?

  • 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-16T05:49:14+00:00Added an answer on June 16, 2026 at 5:49 am

    The view you are calling this.$('.rows_table') from should be in-charge of the element.

    Each Backbone view has an DOM element that it is in-charge of. If you don’t set the element, it is just an empty <div> that is being created by the view.

    You can set the element when you create the view by setting the el element.

    You will need to have a reference to the table element and then:

    var tableElement = $('table')[0]; // or get the reference in a way specific to your code
    var myView = new Backbone.View({
        el : tableElement
    });
    

    And now you can call this.$('.rows_table') from within the view’s methods.

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

Sidebar

Related Questions

I have a file named 'mainZip.zip' ' This file ( 'mainZip.zip' ') contains two
I have a file named page.php and it is something like this; <? include
I have a file named common.cs which contains commonly used functions like this public
I have this case : I have a file named form.php and it contains
I have a file named my file.pdf and I can't delete this file with
I have created a file named MyFile.db using SQLite3 from my C#.net application. This
I have a text file named abc.txt . The file have info like this
I have a file named discussion.php , where a form is located. In this
I have a file named gcc.exe and I have a php page... I want
I have a file named test.txt that is like this: Test Foo Bar But

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.