最近我试图从javascript中使用mshta获得一个快速警报框,但我注意到一些奇怪的东西,而且我没有ideea是什么问题。这一点,在某种程度上,我一直在努力实现:未终止的字符串常量-mshta:javascript
mshta javascript:alert("The file was stored here:\"C:\\folder_with_space_ _.txt");
它给人的错误是一个在这篇文章的标题(炭57)。我试过的东西组合:
//code that works:
mshta javascript:alert("The file was stored here:\"sdadasd");
mshta javascript:alert("The file was stored here:\"\" sdadasd");
//error-notice the space;error on char 35
mshta javascript:alert("The file was stored here:\" sdasds");
它看起来像它给错误时,双引号数量为奇数,但:
//error
mshta javascript:alert("The file was stored here:\" \"sdadasd");
我试图做同样的在浏览器的控制台和它的工作。我相信是某种解析器 - 错误。我该如何解决它?(我正在考虑使用fromCharCode直接插入双引号)。
注意:命令从cmd运行。
命令行中的反斜杠并不像JS中的转义字符。在字符串中使用单引号。 – Teemu