Forums Archive Index > Cool free scripts > NewsBar: fix for HTML encoded text
Date: 15 Aug 2005 6:00 am
Using news including text like e.g. "à" inside the n_content array, the encoded text will not appear correctly until the per-char scrolling reaches the ";" char.
Here is a possible fix that let the cursor jump directly to ";" character:
Code:
if(n_content[n_t][1].charAt(n_cur-1)=="&"){var n_nSemiColIdx=n_content[n_t][1].indexOf(";",n_cur);if((n_nSemiColIdx<n_l)&&(n_nSemiColIdx!=-1)){n_cur=n_nSemiColIdx+1;}}
The code above must be inserted in n_newsbar.js:
Code:
// THE SERIOUS SCRIPT - PLEASE DO NOT TOUCH
n_nS4=document.layers?<_CUT_>:document.getElementById('nnewsb');<INSERT_THE_CODE_ABOVE_HERE>mes=n_content[n_t][0]!=<_CUT_>
Hoping this will help someone... :wink: