treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Webkit and Variables?

  • I created a few variables and put them into an IF statement.

    It almost worked cross-browser.. It even worked in IE6, however, Chrome refused to see the variables properly. (I'm assuming I would have the same problem in Safari).
    I did a bit of debugging and finally realized that the variables were the problem. I managed to fix this, but now I have an IF statement that is illegible due to it's length.

    Is there something simple that could take care of this problem and I'm not aware of?
  • You might want to check to see if you do actually have this problem in Safari. Chrome and Safari use different Javascript engines, which is the only major difference between the two browsers as far as I know.
  • I think I figured out what the problem was.

    Some of the variables began with a dollar sign, and chrome seems to dislike that.