title: Javascript function won't take input, "Uncaught ReferenceError: p is not defined"
body: <p>Problem's occuring when testing in Chrome, but I'm sure it'll happen in any browser.</p>
  
  <p>Why am I getting the error: "Uncaught ReferenceError: p is not defined"? I'm just trying to pass some numbers and directives through, eg. doControllerConversion(p,tr,300); but instead it errors out. Is it because I'm not using strings? I'm at my wits end here...</p>
  
  <p>Thanks so much. I'm a total noob.</p>
  
  <pre><code>function doControllerConversion(s1, o1, u1) {
  
      var selector;
      var orientation;
      var userInput;
      s1 = selector;
      o1 = orientation;
      u1 = userInput;
  
      if (UserSettings.controllerType == "KH606") {
          if (selector == 'p') {
              if (orientation == "toRtraw") {
                  return userInput * 2.85;
              } else if (orientation == 'fr') {
                  return userInput / 2.85;
              }
          } else if (selector == 'b') {
              if (orientation == "tr") {
                  return userInput * 5.10;
              } else if (orientation == 'fr') {
                  return userInput / 5.10;
              }
          } else {
              return errorOut(1);
          }
      }
  
      if (UserSettings.controllerType == "KH609") {
          if (selector == 'p') {
              if (orientation == 'tr') {
                  return userInput * 2.46;
              } else if (orientation == 'fr') {
                  return userInput / 2.46;
              }
          } else if (selector == 'b') {
              if (orientation == 'tr') {
                  return userInput * 5.10;
              } else if (orientation == 'fr') {
                  return userInput / 5.10;
              }
          } else {
              return errorOut(1);
          }
      }
  
      if (UserSettings.controllerType == "KH612") {
          if (selector == 'p') {
              if (orientation == 'tr') {
                  return userInput * 1.20;
              } else if (orientation == 'fr') {
                  return userInput / 1.20;
              }
          } else if (selector == 'b') {
              if (orientation == 'tr') {
                  return userInput * 2.73;
              } else if (orientation == 'fr') {
                  return userInput / 2.73;
              }
          }
      }
  
      if (UserSettings.controllerType == "KH615") {
          if (selector == 'p') {
              if (orientation == 'tr') {
                  return userInput * 0.79;
              } else if (orientation == 'fr') {
                  return userInput / 0.79;
              }
          } else if (selector == 'b') {
              if (orientation == 'tr') {
                  return userInput * 2.55;
              } else if (orientation == 'fr') {
                  return userInput / 2.55;
              }
          }
      }
  
      if (UserSettings.controllerType == "KH618") {
          if (selector == 'p') {
              if (orientation == 'tr') {
                  return userInput * 0.53;
              } else if (orientation == 'fr') {
                  return userInput / 0.53;
              }
          } else if (selector == 'b') {
              if (orientation == 'tr') {
                  return userInput * 1.70;
              } else if (orientation == 'fr') {
                  return userInput / 1.70;
              }
          }
      } else {
          console.log("Error on basic conversion!");
      }
  
  }
  </code></pre>