...

View Full Version : Highlighter Scroller II-loading of ticker array dynamically errors out



seiferlm
06-21-2008, 12:02 AM
I plan to feed the contents of the ticker array from another window into a modal window which will display the ticker. I load the array with the correct href values and verify that the resulting strings mirror exactly would I would otherwise specify directly in the Highlighter code. I replace the “tickercontents[0]=” lines of code (for each element in the array) with some code to build the array as indicated. That’s the only change made to the above script.

But when I create the array this way, then test by simply doing a document.write of one array value, I notice that the URL (when you mouse over the link) includes a full path to the working directory containing my other html files rather than just the URL that was built into the original array string (i.e. file:///C:/Documents%20and%20Settings/MyName/My%20Documents/HTML%20Files/www.google.com). So www.google.com is what is actually stored in the ticker contents array but running the Highlighter script then mousing over the link shows this long path. The script fails at “crosstickParent=crosstick.parentNode? crosstick.parentNode : crosstick.parentElement” in the function start_ticking with an object required error. I notice the URL in the error message also has the long path as above but instead indicating a tmp file.

Since the instructions for using this script indicate the area where the tickercontents array is assigned with values can be edited as long as the code following a certain point in the script is not modified, that implies to me that there is no reason I can’t construct the array values the way I have. That also suggests to me that the script is not precisely bug free since it is unable to handle this scenario without causing the above error. But then I'm a newbie Javascript writer.

So any idea why?

MJ

binaryWeapon
06-21-2008, 12:38 AM
We can't determine what the problem is unless you give a link to the script. I assume it is this.

http://www.javascriptkit.com/script/script2/highlight2.shtml?

seiferlm
06-21-2008, 01:03 AM
Yes. That's the one.

MJ



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum