Welcome to Code Forum!

Join a community that supports you and your coding journey from day one. We strive to be a friendly, supportive community that empowers everyone to be better developers. By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Search results

  1. H

    JavaScript How to add data-id to button, allowing me to remove the 2nd container

    That doesn't work. Edit fiddle - JSFiddle - Code Playground const totalP = document.querySelectorAll("[data-container=\"play1\"]"); ['0', '3', '5', '7'].forEach(function callback(value, index) { players.add(".playSingle" + index, (playerVarsList[index] || {})); });
  2. H

    JavaScript How to add data-id to button, allowing me to remove the 2nd container

    But that is not the code I am trying to have work. It's the code with the console log statements I am trying to have work: Edit fiddle - JSFiddle - Code Playground ['0', '3', '5', '7'].forEach(function callback(value, index) { console.log(players.add); console.log(".playSingle" +...
  3. H

    JavaScript How to add data-id to button, allowing me to remove the 2nd container

    I'm using it as a template, because it is one that uses .forEach.
  4. H

    JavaScript How to add data-id to button, allowing me to remove the 2nd container

    The same way as how it works here: Edit fiddle - JSFiddle - Code Playground Where all the videos, when the buttons are clicked, are viewable. That is my goal or intention of how the code should work.
  5. H

    JavaScript How to add data-id to button, allowing me to remove the 2nd container

    I just fixed them here: Edit fiddle - JSFiddle - Code Playground They tell me this:
  6. H

    JavaScript How to add data-id to button, allowing me to remove the 2nd container

    There are 3 console logs in here now: Edit fiddle - JSFiddle - Code Playground ['0', '3', '5', '7'].forEach(function callback(value, index) { console.log(players.add); console.log(".playSingle" + [index], console.log(playerVarsList[value] || {})); }); I don't understand what I am...
  7. H

    JavaScript How to add data-id to button, allowing me to remove the 2nd container

    How do I do that then? If that will have the code working, where the videos will be viewable.
  8. H

    JavaScript How to add data-id to button, allowing me to remove the 2nd container

    Maybe it can't work in the code using .forEach.
  9. H

    JavaScript How to add data-id to button, allowing me to remove the 2nd container

    0, 3, 5, 7, the numbers match. The code is supposed to work with the numbers not in order like that. Are you telling me something different?
  10. H

    JavaScript How to add data-id to button, allowing me to remove the 2nd container

    Did what you told me to do in the code, did it work for you? Did I do something wrong? or, did I forget to do something? The code is not working: https://jsfiddle.net/Lfr5g3ed/ //to add the player to all the play buttons const totalP =...
  11. H

    JavaScript How to add data-id to button, allowing me to remove the 2nd container

    How do I get the code back to working? https://jsfiddle.net/nu602xe5/1/ How many things are left to be done in the code? const players = (function coverUIPlayerFacade() { function addPlayer(coverSelector, playerOptions) { const cover = document.querySelector(coverSelector); const...
  12. H

    JavaScript How to add data-id to button, allowing me to remove the 2nd container

    What exactly should I be doing now? How do I get the code working? https://jsfiddle.net/nu602xe5/1/ Were you wanting me to do something in the code?
  13. H

    JavaScript How to add data-id to button, allowing me to remove the 2nd container

    What am I making cahnges to in here? function onYouTubeIframeAPIReady() { let playerVarsList = { "0": { playerVars: { playlist: "0dgNc5S8cLI,mnfmQe8Mv1g,-Xgi_way56U,CHahce95B1g" } }, "3": { videoId: "0dgNc5S8cLI" }, "5": { playerVars: {...
  14. H

    JavaScript How to add data-id to button, allowing me to remove the 2nd container

    Then what? https://jsfiddle.net/nu602xe5/1/ How do I get the code to work? ['0', '3', '5', '7'].forEach(function callback(value, index) { players.addPlayer(".playSingle" + index, (playerVarsList[index] || {})); });
  15. H

    JavaScript How to add data-id to button, allowing me to remove the 2nd container

    What should I be doing now? I am all confused right now. How do I get the code working?
  16. H

    JavaScript How to add data-id to button, allowing me to remove the 2nd container

    const players = (function coverUIPlayerFacade() { function addPlayer(coverSelector, playerOptions) { const cover = document.querySelector(coverSelector); const wrapper = manageUI.getWrapper(cover); const callback = managePlayer.adder(wrapper, playerOptions)...
  17. H

    JavaScript How to add data-id to button, allowing me to remove the 2nd container

    I am confused still. Removing .add() I get this error. I did this the wrong way? I was supposed to do something else? ['0', '3', '5', '7' ].forEach(function callback(value, index) { players(".playSingle" + index, (playerVarsList[index] || {})); }); Then I get this error...
  18. H

    JavaScript How to add data-id to button, allowing me to remove the 2nd container

    playerVarsList appears to be an object that contains object values that contain a property called playerVars. players is not an array. players is a function that returns an object with methods. The methods add an init. It looks like the players function gets called 4 times down on line 446. It...
Back
Top Bottom