javascript escape chars with window.status and title

Necuno

Court Jester
Joined
Sep 27, 2005
Messages
58,566
Reaction score
3,437
the thing is, todayString should read as

Use Today's Date

Code:
document.getElementById("lblToday").innerHTML =	todayString + " <a class='today-style' onmousemove='window.status=\""+gotoString+"\"' onmouseout='window.status=\"\"' title='"+gotoString+"' href='javascript:dateSelected=dateNow;closeCalendar();'>"+dayName[(today.getDay()-startAt==-1)?6:(today.getDay()-startAt)]+", " + dateNow + " " + monthName[monthNow].substring(0,3)	+ "	" +	yearNow	+ "</a>";

i have tried todayString as

todayString = "Use Today\'s Date"

but then it gives an error of a runtime error has occired. do you wish to debug? line:0 error: unterminated string constant.

though as i understand per goog-ing it is \' for a single '
 
I'm going to guess here (possible disclaimer needed)...

But aren't you looking for HTML escape characters if you want to change the window title on a browser?

Something like:
Code:
todayString = "Use Today&#_146;s Date"

Without the _ MBB changed it back to a ' :p
 
Last edited:
Top
Sign up to the MyBroadband newsletter
X