android phonegap插件的java脚本调用 [英] android phonegap plugin's java script call
本文介绍了android phonegap插件的java脚本调用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在Android中使用JNI创建了一个应用程序,NDK和phonegap插件fr android。
这里我使用的java本机代码调用java脚本函数函数
i have created an app in android using JNI,NDKand phonegap Plugin fr android.
Here i am calling the java script functions from the java native code using the function
sendJavascript(SendJS);
和SendJS如下:
and the SendJS is made as follows:
SendJS = "javascript:" + SuccessCallBack + "('" + JSONObject.quote(result.toString()) + "')";
到目前为止,它的工作正常,因为我的字符串结果在结果中没有'
。
但现在我的结果中得到'
,因此我的
sendJavascript(SendJS);
无效并给我
is not working and gives me
phonegap-1.0.0.js: Line 778 : JSCallback Error: SyntaxError: Parse error
它适用于 Double Quotes()
和 \ '
也无法正常工作。
所以任何人都可以帮助我摆脱这个问题......
it's working perfectly fine for Double Quotes(")
and \'
is also not working.
so can any one plz help me to get out of this problem...
推荐答案
这是一件傻事......
替换'
使用\\'
,而不是\'
....
休息是一样的......
it was a silly thing...
replace'
with\\'
,not with\'
....
thn rest are same as it was...
请提供这个android phonegap插件的java脚本调用的完整代码
i急需
please provide the full code fro this android phonegap plugin's java script call
i required urgently
这篇关于android phonegap插件的java脚本调用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文