I am getting a value from the server and directly assigning it to a field using javascript. Below is the code.
document.getElementById('myid')='<%= myServerValue%>';
But the issue is when myServerValue contains single quote javascript functionality collapsed.
Since it is like document.getElementById('myid')='myvalue'isx';
[there is a single quote]
Please tell me a solution. Using double quotes too will not be a good option, since myServerValue could contain double quotes also...