" var iCurrent = parseInt(document.getElementById('" + lblWordCount.ClientID + "').innerText);" +
SOLUTION: Use innerHTML instead of innerText e.g.
//Note: Don't use innerText as it isn't supported by Firefox
" var iCurrent = parseInt(document.getElementById('" + lblWordCount.ClientID + "').innerHTML);" +
CAVEATS: Ok, so after a bit more googling (http://stackoverflow.com/questions/1359469/innertext-works-in-ie-but-not-in-firefox) it's definitely not the preferred solution and has issues itself, but for my simple scenario it worked ok. Ideally I should probably be using some jquery or accessing the DOM properly etc. I'm open to here better solutions.
No comments:
Post a Comment