javascript字串中有些特殊字符不能直接照写,要escape(脱出或转义),这个"\"就是转义用的特殊字符。
比如"\n"表示回车,"\t"表示制表符,实际上都是 * 一个 * 字符。所以"\\"表示斜杠 \, 还有 \" 表示引号 ", 
如果字符串中出现了\, 而后面的字符不是上述的转移字,\被简单忽略。如果这样写"folder1\MyDoc"则由于 \M不是转义字,\ 被简单忽略。

解决方案 »

  1.   

    Special Characters
    JScript provides special characters that allow you to include in strings some characters you cannot type directly. Each of these characters begins with a backslash. The backslash is an escape character you use to inform the JScript interpreter that the next character is special.Escape Sequence Character 
    \b Backspace 
    \f Form feed 
    \n Line feed (newline) 
    \r Carriage return 
    \t Horizontal tab (Ctrl-I) 
    \' Single quotation  
    \" Double quotation  
    \\ Backslash Notice that because the backslash itself is used as the escape character, you cannot directly type one in your script. If you want to write a backslash, you must type two of them together (\\).document.write('The image path is C:\\webstuff\\mypage\\gifs\\garden.gif.');
    document.write('The caption reads, "After the snow of \'97. Grandma\'s house is covered."');