Help fixing a script for Youtube

in Script development
Subscribe to Help fixing a script for Youtube 3 posts, 2 voices



Cody Bellinger Scriptwright
FirefoxX11

Let me start off by saying that I am not fluent in Javascript at all! I have been slowly picking up from online tutorials on how to do things properly, and it seems this time that I cannot help myself with this script. That is why I came here for help!

For some reason this script will not work what-so-ever in firefox. In the error console, it says there is a syntax error a line after the scripts last line.
Here is the link to the coding on pastebin: http://pastebin.com/miiw38zK

Any help would be much appreciated!
~Regards!
Cody B.

 
kuzu Scriptwright
FirefoxMacintosh

For one thing, you have 10 { and only 8 }. Outside of string literals and comments these generally need to be matched. In particular, it looks like you need a } in front of both of the two else lines.

Also, the multi-line string literal representation is atypical. I guess that is E4X, but note that E4X is deprecated in Firefox and not well supported by other browsers. It also confuses tools like JSHint, which otherwise might have been used to help find the unmatched { problem.

 
Cody Bellinger Scriptwright
FirefoxX11

Thank you for your help kuzu! I have fixed the script using your suggestions, and it is now up here: http://userscripts.org/scripts/show/138883