Hello.
I have a Javascript ticker, which scrolls horizontally across the screen. The Javascript creates the marquee where the text scrolls as well as actually jumping the text across the page. In addition, there are checks and different functions depending on what browser is being used.
Alone in a .aspx file this ticker works exactly as it should. But when I put it into a .aspx file with other content, both HTML and .NET it gives a
Error: 1.offsetWidth is null or not an object
This error refers to the block of code:
ns6divw = eval(whichdiv);
ns6divw.style.left = newsWidth;
ns6divw.innerHTML = ‘<nobr>’+’Some message’+'</nobr>’;
var nobrnode = ns6divw.getElementsByTagName(‘span’);
sizeupw = nobrnode[1].offsetWidth;
sizeupw = ns6divw.offsetWidth;
And the line where the error occurs is at sizeupw = nobrnode[1].offsetWidth;
I’m confused because in the separate file, this object isn’t null but once I implement it in my .aspx content page, it is.
Is there something I’m missing? Does anyone have any ideas?