As I was coding in JavaScript on an Asp.NET page today, I encountered a small issue. Here's what happened:
<script type="type/javascript">
var elementID = document.getElementById("<%=txtMyServerControl.ClientID %>")
</script>
The compiler threw an error, but adding a space between =
and txtMyServerControl
resolved the issue for me. Oddly enough, my code worked perfectly on my co-worker's computer without that extra space.
Does anyone have any insight into why this discrepancy occurred?
Note: The error mentioned above was the only issue, despite compiling multiple times before identifying the problem.