I am experiencing a Javascript issue where the code works fine on my laptop while connected to localhost but fails when transferred to a remote server and accessed from the same laptop and browser (IE11). The portion of code causing trouble is as follows:
var wktxt = inputs[i].getAttribute( "ondblClick" );
wktxt = wktxt.replace("(" + rowno, "(" + rowcnt)
inputs[i].setAttribute( "ondblClick", wktxt );
inputs[i].style.backgroundImage = "url()";
The problem arises at the second line with an error message stating "Object doesn't support property or method 'replace'", despite not encountering this issue locally. The intended behavior is for this logic to clone a row within an HTML table. Upon debugging the failure, I found that wktxt holds the value "function ondblclick() {AddNotes2(1,0)}", with rowno being 1 and rowcnt being 7.
Do you have any insights into why this might be happening? This code snippet is executed within a loop - could the variable declaration potentially be causing the problem by re-executing on each iteration?