Search results

  1. Annabelle5893

    Playing Audio Using Keystrokes: Is It Possible?

    How's this? //grab the button 'hookSwitch' var hookSwitch = document.querySelector('button.hookSwitch'); //create an event listener for a click event hookStatus.addEventListener("onclick", function(){ //inside of the callback function for click event listener, add the on/off classes to the...
  2. Annabelle5893

    Playing Audio Using Keystrokes: Is It Possible?

    Are you thinking of the parts where there are spaces before the } solos (The lines with just closing braces)? Are those the ones that should have "});"?
  3. Annabelle5893

    Playing Audio Using Keystrokes: Is It Possible?

    Which line are you referring to where the callback function is right, but I need to select the right event type?
  4. Annabelle5893

    Playing Audio Using Keystrokes: Is It Possible?

    How's this? //grab the button 'hookSwitch' var hookSwitch = document.querySelector('button.hookSwitch'); //create an event listener for a click event hookStatus.addEventListener("onclick", function(){ //inside of the callback function for click event listener, add the on/off classes to the...
  5. Annabelle5893

    Playing Audio Using Keystrokes: Is It Possible?

    Let me rephrase that. Should I put Something like: button.addEventListener('click', function() { In that second case? The one that you say lacks an event listener? Or should I put something like: button.addEventListener("ended", function() {
  6. Annabelle5893

    Playing Audio Using Keystrokes: Is It Possible?

    I could tell right away that the second case was missing a function. But what function is supposed to be there, I'm not exactly sure.
  7. Annabelle5893

    Playing Audio Using Keystrokes: Is It Possible?

    I'm guessing that on the part between var policeComplaint" and " var pickupDefault;", there's a "default:" statement without a "case" code.
  8. Annabelle5893

    Playing Audio Using Keystrokes: Is It Possible?

    Sure thing! Here ya go. //grab the button 'hookSwitch' var hookSwitch = document.querySelector('button.hookSwitch'); //create an event listener for a click event hookStatus.addEventListener("onclick", function(){ //inside of the callback function for click event listener, add the on/off...
  9. Annabelle5893

    Playing Audio Using Keystrokes: Is It Possible?

    By "entire code", do you want both the HTML and the Javascript?
  10. Annabelle5893

    Playing Audio Using Keystrokes: Is It Possible?

    Here's another error. And here's the corresponding code. function dialToneTimedOut() { allowDial=false; timeoutHowler(); if(DialToneTimedOut == true) { timeoutHowler.play(); timeoutHowler.currentTime=0; } }
  11. Annabelle5893

    Playing Audio Using Keystrokes: Is It Possible?

    I wonder if this is what you're thinking of. //grab the button 'hookSwitch' var hookSwitch = document.querySelector('button.hookSwitch'); //create an event listener for a click event hookStatus.addEventListener("onclick"), function() { //inside of the callback function for click...
  12. Annabelle5893

    Playing Audio Using Keystrokes: Is It Possible?

    How about this one? //grab the button 'hookSwitch' var hookSwitch = document.querySelector('button.hookSwitch'); //create an event listener for a click event hookStatus.addEventListener("onclick", function(){ //inside of the callback function for click event listener, add the on/off...
  13. Annabelle5893

    Playing Audio Using Keystrokes: Is It Possible?

    How's this version? //grab the button 'hookSwitch' var hookSwitch = document.querySelector('button.hookSwitch'); //create an event listener for a click event //inside of the callback function for click event listener, add the on/off classes to the span like this: //grab the span element var...
  14. Annabelle5893

    Playing Audio Using Keystrokes: Is It Possible?

    I bet one of the pieces of missing logic is the statement: switch (event.keycode) { case 32: toggleLineStatus(); break;
  15. Annabelle5893

    Playing Audio Using Keystrokes: Is It Possible?

    I hope this looks right to you. var hookSwitch = document.querySelector('button.hookSwitch'); //create an event listener for a click event //missing logic //inside of the callback function for click event listener, add the on/off classes to the span like this: //grab the span element var...
  16. Annabelle5893

    Playing Audio Using Keystrokes: Is It Possible?

    I manually typed your code in, and this is what I got.
  17. Annabelle5893

    Playing Audio Using Keystrokes: Is It Possible?

    How's this? //grab the button 'hookSwitch' var hookSwitch = document.querySelector('button.hookSwitch'); //create an event listener for a click event //inside of the callback function for click event listener, add the on/off classes to the span like this: //grab the span element var...
  18. Annabelle5893

    Playing Audio Using Keystrokes: Is It Possible?

    The lines that say things like: //inside of the callback function for click event listener, add the on/off classes to the span like this: //grab the span element
  19. Annabelle5893

    Playing Audio Using Keystrokes: Is It Possible?

    Would I need all the stuff within the slashes? Or is that not necessary for the programming.
Top Bottom