简体   繁体   English

yuicompressor错误,不确定是什么问题?

[英]yuicompressor error, not sure what is wrong?

Very confused here, trying out the yuicompressor on a simple javascript file. 这里很困惑,在一个简单的javascript文件上试用yuicompressor。

My js file looks like: 我的js文件看起来像:

function splitText(text)
{
    return text.split('-')[1];
}

The error is: 错误是:

[INFO] Using charset Cp1252 [INFO]使用charset Cp1252

[Error] 1:20:illegal character [Error] 1:20:syntax error [Error] 1:40:illegal character [Error] 1:49:missing ; [错误] 1:20:非法字符[错误] 1:20:语法错误[错误] 1:40:非法字符[错误] 1:49:丢失; before statement [Error] 1:50:illegal character .. .. [Error] 7:3:missing | 在声明之前[错误] 1:50:非法字符.. .. [错误] 7:3:丢失| in compound statement [error] 1:0:compilation produced 38 syntax errors ... 在复合语句中[错误] 1:0:编译产生了38个语法错误...

Can someone please explain to me what is wrong? 有人可以向我解释有什么问题吗?

Your encoding of the actual file YUICompressor is acting on is the issue. 你对YUICompressor实际文件的编码是个问题。 Open the file in notepad++ and change to ANSI & it should work. 在notepad ++中打开文件并更改为ANSI,它应该可以工作。

[ http://extjs.com/forum/showthread.php?t=27732][1] [ http://extjs.com/forum/showthread.php?t=27732] [1 ]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM