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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:18:04+00:00 2026-05-23T22:18:04+00:00

I’m curious as to how many of these queue methods I can encapsulate into

  • 0

I’m curious as to how many of these queue methods I can encapsulate into the Timeline object. I would like to add DOM to update a table with what’s been added into the queue and am curious as to whether I should put it in this same object as well or break it off into another function, if so, how do I then pass arguments?

I’m unsure as to how to implemint this with objects. Would you just write it addTableRow(this.clips.url)? Or should I encapsulate addTableRow() into the Timeline object?

The two objects storing the info and running the array commands.

        function Clip() {
            this.url = userInput.url.value;
            this.inpoint = userInput.inpoint.value;
            this.outpoint = userInput.outpoint.value;
        }

        function Timeline() {
            this.clips = []; 

            this.queue = function() {
                this.clips.push(new Clip());
                addTableRow(this.clips.url); //Creates the new table with the user's URL inside.
            }
        }

        var myTime = new Timeline();

        //Adds the new table row.
        function addTableRow(url) {
            function delayed() {
                var table=document.getElementById("tblVideo");
                var lastRow = table.rows.length;
                // if there's no header row in the table, then iteration = lastRow + 1
                var iteration = lastRow;
                var row = table.insertRow(lastRow);
                var cell1=row.insertCell(0);
                cell1.innerHTML=url;
            }
            setTimeout(delayed,500);
        }

How its working with the user’s input:

        <form id = "userInput">
        <p>
        Url: <input type="text" id="url" size="30" />
        Start Time: <input type="text" id="inpoint" size="2" />
        End Time: <input type="text" id="outpoint" size="2" />
        <input type="button" onclick="myTime.queue()" value="Add" />
        </p>
        </form>

        <table border = "1" id = "tblVideo">
            <tr>
                <th>Youtube URL</th>
            </tr>
        </table>

I’ve already tried .apply() and .call() but I’m not sure if I was using them correctly. With the current code it updates the table with undefined. I not only want to pass the url but the inpoint and outpoint to the table as well.

I’ve been looking around and having really found an example that is like the one I currently have.

  • 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-23T22:18:05+00:00Added an answer on May 23, 2026 at 10:18 pm

    Your only real problem is that clips.url is invalid…there are two ways you can access this object within this array…first, put the object in a variable before you push it to the array, or just get the last object in the array like I did here in this jsFiddle.

    Here is the jsFiddle using the first option I discussed…which was creating the object first, and then pushing it to the array and using it to add to the table.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I am currently running into a problem where an element is coming back 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.