var url = "C:\xampp\htdocs\wcf2\wcf/attachments/5d/18-5dffacdfe6d2cf1db8dfabbb5b53ae8dc65bd325";
结果Uncaught SyntaxError: Unexpected token ILLEGAL
。有什么方法可以在 javascript 中修复它,还是我需要在 PHP 中转义它?
编辑:我的脚本如下所示:
<script>
window.onload = function() {
thingiurlbase = "{@$__wcf->getPath('td')}js";
thingiview = new Thingiview("viewer");
thingiview.setObjectColor('#C0D8F0');
thingiview.initScene();
var url = "C:\\xampp\htdocs\\wcf2\\wcf/attachments/5d/18-5dffacdfe6d2cf1db8dfabbb5b53ae8dc65bd325";
thingiview.loadSTL(url);
thingiview.setRotation(false);
}
</script>