Hi,
This is my first post so thanks for your help and patienceI’m a server-side dev and am picking up some client side javascript for the first time so really I’m a newbie.
Here's the code snippet:
_______________________________________
// create free number
var free_text_span = document.createElement("SPAN");
free_text_span.className = this.CSS_NUMBER_FREE_TEXT_SPAN;
free_text_span.appendChild(document.createTextNode(" " + freeNumberText + " "));
highlightTextAreaElement.appendChild(free_text_span);
_______________________________________
The problem is the “ “ result in the screen blinking and then CPU going up to 100%.
If I remove the spaces there is no thrashing and all is well (but I need the spaces there):
_______________________________________
free_text_span.appendChild(document.createTextNode(freeNumberText));
_______________________________________
I’ve tried to use innerHTML without success, but this could be user error:
_______________________________________
// create free number
var free_text_span = document.createElement("SPAN");
free_text_span.className = this.CSS_NUMBER_FREE_TEXT_SPAN;
free_text_span.innerHTML = " " + freeNumberText " ";
highlightTextAreaElement.appendChild(free_text_span);
_______________________________________
I’d really appreciate someone to point out where I’m going wrong.
Many thanks,
Mick


I’m a server-side dev and am picking up some client side javascript for the first time so really I’m a newbie.
Reply With Quote
Bookmarks