View Full Version : Script problems resulting from cleaning up code.

01-30-2005, 11:36 PM
Recently I noticed while using a newer browser that a script I wrote doesn't work properly anymore. After throwing myself at the thing for the better part of a week, and using some new tools(jslint, firefox), I got the script active again, but it's not doing what it used to. Most frustrating is that I fixed a couple things with help from jslint, and was closer to what I originally had wanted as far as output, but after fixing all the problems, I seem to have stepped backwards.

In particular, I have a script that will randomly choose a lyric from a listing within the script, split the lyric into individual lines, fade in the line, fade it back out, then move down 1 line and display the next line. The script does this until the artist/title are displayed, then fades out and fades the entire text back in where each line was displayed the first time, and then stops.

This used to work well in IE 5.x, but now I can only get the first line to display and then everything is blank. Before I fixed all the errors jslint told me about, I was getting each line displayed on the same line one after the next, then the entire lyric displayed correctly. I'm confused as to why this is happening and why after fixing "errors" it no longer will display past the first line.

It's extremely frustrating to see the script apparently working, yet not doing what it's supposed to, despite limited fixing(i.e. brackets for inline if statements, use of === for 0 eval etc.). The code itself hasn't changed at all, so I'm wondering why the browsers are not displaying it as they used to. Is there something w/ the document.foo notation that changed so I need to update my calls, or is this just totally impossible to figure out w/o the code?

I apologize for my somewhat limited knowledge right now. I taught myself javascript over a summer(by fixing up this script to do what I wanted), and I obviously didn't learn enough ;)


01-31-2005, 12:51 AM
It's hard help without seeing the code.