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

    Did I do this right? https://jsfiddle.net/62krvnzf/ totalP.forEach(function (someArr,index) { console.log(someArr[index]); players.add(".playSingle" + index, (playerVarsList[index] || {})); });
  2. H

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

    I'm confused now. Which code are you referring to? This code gives me No Error. https://jsfiddle.net/3hutLq0s/ totalP.forEach(function (_,index) { players.add(".playSingle" + index, (playerVarsList[index] || {})); }); This code Gives Me An Error. https://jsfiddle.net/3hutLq0s/1/...
  3. H

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

    I was told this is valid code by multiple people: https://jsfiddle.net/suawgv46/ Either they are all wrong, or you are wrong. Can you definitely say, 100% they are all wrong? totalP.forEach(function (_,index) {
  4. H

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

    No error occurring in the code, so that prevents the error from appearing.
  5. H

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

    Perhaps this is valid then: totalP.forEach(function (_,index) {
  6. H

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

    What was the reason you had me do that for if it breaks the code? Were you mistaken? https://jsfiddle.net/suawgv46/
  7. H

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

    Then I receive this error: https://jsfiddle.net/suawgv46/ Did you receive this error when you did what you had me do?
  8. H

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

    jslint is saying: 'Unused '_' - How would that be fixed? https://jsfiddle.net/eptu01xg/ totalP.forEach(function (_, index) { players.add(".playSingle" + index, (playerVarsList[index] || {})); });
  9. H

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

    Do this then? function initPlayer(wrapper, playerOptions) { if (wrapper === "undefined" && wrapper === null) { show(wrapper); const player = createPlayer(wrapper, playerOptions); wrapper.player = player; } }
  10. H

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

    How would this be fixed in the code? function initPlayer(wrapper, playerOptions) { if (typeof wrapper !== "undefined" && wrapper !== null) { show(wrapper); const player = createPlayer(wrapper, playerOptions); wrapper.player = player; } }
  11. H

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

    Fixed: https://jsfiddle.net/q6omxswa/ document.querySelectorAll('button.cover').forEach(function(button) { button.addEventListener('click', function(event) { const container = event.currentTarget.dataset.container; const myVideo = document.querySelector('.' + container + ' .video')...
  12. H

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

    Cannot read properties of undefined (reading 'wrapper')" The error happens because I added <button class="playInitial cover spinner" type="button" data-container="play1" data-id="EK3h0IADYrQ"> to the source code. This increases totalPlayButtons I need to change the way totalPlayButtons is...
  13. H

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

    An attempt at fixing: Replacing this line: players.add(".playSingle" + i, (playerVarsList[i % (Object.keys(playerVarsList).length)] || With this line: players.add(".playSingle" + i, (playerVarsList[i] || {})); Did not work. I just tried. t breaks button 3 when I do that...
  14. H

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

    All I asked was, is there a way to look at how the demo code is written, to be able to make the appropriate changes in the other code? https://jsfiddle.net/7xz6gw1b/ Because in the demo code it works as it should. Demo Code: https://jsfiddle.net/awht6u37/ Is looking at the demo code helpful...
  15. H

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

    I am trying to replicate how it works in the demo code, https://jsfiddle.net/awht6u37/ In the demo code it works as it should. Looking at the above code, I am not sure what would get adjusted in here: https://jsfiddle.net/7xz6gw1b/ I have been changing things around in here but nothing is...
  16. H

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

    All I know is this. How do I fix the problem that is in the code presently? Where the behavior in this demo code: https://jsfiddle.net/awht6u37/ The correct video appears here when clicking on <button> #3. <div class="playButtonContainer with-curtain "> <button class="playSingle0 cover"...
  17. H

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

    There is this piece: function findPlayers() { const allCovers = document.querySelectorAll(".cover"); const allWrappers = document.querySelectorAll(".wrap"); allCovers.forEach(function addToPlayers(cover, index) { players.push({ "cover": cover, "wrapper": (index...
  18. H

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

    I have no idea how something like that would be debugged and fixed.
  19. H

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

    Is that something that is fixable in the code? The correct video not appearing?
Back
Top Bottom