javascript eval backslash in window NT path problem
- by Hammad Tariq
I am experiencing a classic JS case (in my opinion) but after a lot of googling, still not able to find a solution. Backslash is considered as a escape character in JS but what you need when you need to pass windows path from the JS and print it?
I am using eval because my java applet is executing the code and placing bits when it has a string to evaluate. That's why eval is necessary, however I have made an example which is below:
<div id="mainTabs"></div>
<script>
var s = "document.getElementById('mainTabs').innerHTML='\\C\ganye\file.doc'";
eval(s);
</script>
I tried double backslashes, not working, if anyone could help me get around this with as less hassle as possible, I will feel grateful.