Hi,
This is my first post so thanks for your help and patience
I’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