We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Log:I/chromium: [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected identifier", source: (1)。 我在调用jsCallback.apply()时,传入一个String对象,在apply方法里,有这样的代码:
StringBuilder sb = new StringBuilder(); for (Object arg : args){ sb.append(","); boolean isStrArg = arg instanceof String; if (isStrArg) { sb.append("\""); } sb.append(String.valueOf(arg)); if (isStrArg) { sb.append("\""); } }
此方法会在参数首尾加上双引号。此时当传入的String对象包含双引号时(JSONObject.toString()方法生成的String对象就会包含双引号),就会出错。不包含则不会出现问题。 将append里面的双引号改成单引号能解决此问题。但是如果String对象包含单引号就又会导致这个问题了- - 延伸到既包含双引号又包含单引号的String对象又该如何传递呢?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Log:I/chromium: [INFO:CONSOLE(1)] "Uncaught SyntaxError: Unexpected identifier", source: (1)。
我在调用jsCallback.apply()时,传入一个String对象,在apply方法里,有这样的代码:
此方法会在参数首尾加上双引号。此时当传入的String对象包含双引号时(JSONObject.toString()方法生成的String对象就会包含双引号),就会出错。不包含则不会出现问题。
将append里面的双引号改成单引号能解决此问题。但是如果String对象包含单引号就又会导致这个问题了- -
延伸到既包含双引号又包含单引号的String对象又该如何传递呢?
The text was updated successfully, but these errors were encountered: