Hello:
There must be something I don't understand about the timing or order of parsing the javascript code and merging it back with the static HTML. I have a variable that is declared and filled in the server side code, before the HTML declarations begin. A little while down the HTML page, I have a call to server side code. After this code runs, the variable is now null!
Here is my sample code and output.
Code (in HTML page - the variable strComment1 is declared and filled by a database lookup in server side code.):
<%Response.Write("The comment is :" + strComment1 + ": and now it is :" + strComment1 +":");%>
Output:
The comment is :this is a comment: and now it is :null:
Heisenberg's uncertainty principle states that observing a phenomenon changes the phenomenon, but this is ridiculous! I have heard of these things referred to as a "Heisenbug" in programming - a bug that changes when you test it.
I can work around my specific problem - I just want to understand why this happens.
TIA,
Dan
Dan Walter
Daniel.Walter@uvm.edu
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
There must be something I don't understand about the timing or order of parsing the javascript code and merging it back with the static HTML. I have a variable that is declared and filled in the server side code, before the HTML declarations begin. A little while down the HTML page, I have a call to server side code. After this code runs, the variable is now null!
Here is my sample code and output.
Code (in HTML page - the variable strComment1 is declared and filled by a database lookup in server side code.):
<%Response.Write("The comment is :" + strComment1 + ": and now it is :" + strComment1 +":");%>
Output:
The comment is :this is a comment: and now it is :null:
Heisenberg's uncertainty principle states that observing a phenomenon changes the phenomenon, but this is ridiculous! I have heard of these things referred to as a "Heisenbug" in programming - a bug that changes when you test it.
I can work around my specific problem - I just want to understand why this happens.
TIA,
Dan
Dan Walter
Daniel.Walter@uvm.edu
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }