使用facebookconnect插件时不能调用未定义的分割
cannot call split of undefined when using facebook connect plugin for phonegap
我在尝试调用FB.login()函数时遇到问题。
堆栈跟踪表明facebook连接插件被正确初始化,但当我试图调用登录函数时,我得到一个错误:///android_asset/www/cd -plugin-fb-connect.js:39
似乎第39行的params变量没有定义。
我使用cordova 2.6.0.js在android 4.1.1上开发HTC one X
04-17 11:07:18.804: I/CordovaLog(27283): Changing log level to DEBUG(3)
04-17 11:07:18.804: I/CordovaLog(27283): Found preference for useBrowserHistory=true
04-17 11:07:18.804: D/CordovaLog(27283): Found preference for useBrowserHistory=true
04-17 11:07:18.804: I/CordovaLog(27283): Found preference for exit-on-suspend=false
04-17 11:07:18.804: D/CordovaLog(27283): Found preference for exit-on-suspend=false
04-17 11:07:18.804: D/DroidGap(27283): DroidGap.onCreate()
04-17 11:07:19.499: D/JsMessageQueue(27283): Set native->JS mode to 2
04-17 11:07:19.519: D/DroidGap(27283): DroidGap.init()
04-17 11:07:19.559: D/CordovaWebView(27283): >>> loadUrl(file:///android_asset/www/login.html)
04-17 11:07:19.559: D/PluginManager(27283): init()
04-17 11:07:19.584: D/CordovaWebView(27283): >>> loadUrlNow()
04-17 11:07:19.584: D/DroidGap(27283): Resuming the App
04-17 11:07:19.664: D/SoftKeyboardDetect(27283): Ignore this event
04-17 11:07:19.879: E/(27283): file /data/data/com.nvidia.NvCPLSvc/files/driverlist.txt: not found!
04-17 11:07:19.879: I/(27283): Attempting to load EGL implementation /system/lib//egl/libEGL_tegra_impl
04-17 11:07:20.154: I/(27283): Loaded EGL implementation /system/lib//egl/libEGL_tegra_impl
04-17 11:07:20.569: I/(27283): Loading GLESv2 implementation /system/lib//egl/libGLESv2_tegra_impl
04-17 11:07:20.609: I/Choreographer(27283): Skipped 53 frames! The application may be doing too much work on its main thread.
04-17 11:07:21.059: W/dalvikvm(27283): disableGcForExternalAlloc: false
04-17 11:07:21.164: D/SoftKeyboardDetect(27283): Ignore this event
04-17 11:07:21.319: D/DroidGap(27283): onMessage(onPageStarted,file:///android_asset/www/login.html)
04-17 11:07:24.679: D/chromium(27283): Unknown chromium error: -6
04-17 11:07:24.689: D/Cordova(27283): onPageFinished(file:///android_asset/www/login.html)
04-17 11:07:24.689: D/Cordova(27283): Trying to fire onNativeReady
04-17 11:07:24.689: D/DroidGap(27283): onMessage(onNativeReady,null)
04-17 11:07:24.689: D/DroidGap(27283): onMessage(onPageFinished,file:///android_asset/www/login.html)
04-17 11:07:24.739: D/CordovaNetworkManager(27283): Connection Type: 3g
04-17 11:07:24.739: D/DroidGap(27283): onMessage(networkconnection,3g)
04-17 11:07:24.739: D/CordovaNetworkManager(27283): Connection Type: 3g
04-17 11:07:24.744: D/DroidGap(27283): onMessage(spinner,stop)
04-17 11:07:25.094: W/dalvikvm(27283): disableGcForExternalAlloc: false
04-17 11:07:26.699: D/ConnectPlugin(27283): init: Initializing plugin.
04-17 11:07:26.739: D/DroidGap(27283): onMessage(spinner,stop)
04-17 11:07:26.759: D/CordovaLog(27283): Cordova Facebook Connect plugin initialized successfully.
04-17 11:07:26.759: I/Web Console(27283): Cordova Facebook Connect plugin initialized successfully. at file:///android_asset/www/cdv-plugin-fb-connect.js:24
04-17 11:07:26.759: W/dalvikvm(27283): disableGcForExternalAlloc: false
04-17 11:07:28.004: D/CordovaLog(27283): Uncaught TypeError: Cannot call method 'split' of undefined
04-17 11:07:28.004: E/Web Console(27283): Uncaught TypeError: Cannot call method 'split' of undefined at file:///android_asset/www/cdv-plugin-fb-connect.js:39
没关系,我已经修好了。正如我从这个线程中发现的,我在FB.login()调用中使用了错误的范围。
相关文章:
- 为什么“;未定义的“;在JavaScript中结束循环
- 要求未定义JS回调参数
- 如何检查管道中未定义的项目
- TypeError:无法读取属性'推'未定义的JavaScript
- $window.ga在AngularJS事件中未定义
- 未捕获的TypeError无法读取未定义的属性socialsharing
- 为什么grunt contrib connect的中间件选项的第三个参数是未定义的
- 无法获取属性'selectedIndex'的未定义引用或null引用
- 如何消除代码中的未定义和其他问题
- 未捕获的ReferenceError:$未定义
- this.router在AngularJS 2中未定义
- 未捕获的类型错误:无法读取属性'删除'的未定义
- 节点fs.stat名称未定义
- 尝试在PHP中回显输入文本时出现未定义的索引错误
- Jquery未定义函数正在停止其他操作
- AngularJS指令出错-无法读取属性'编译'的未定义
- 这.SOMETHING 总是返回未定义的 - extjs
- 无法获取属性'Id'使用Knockout.js的未定义或空引用API
- Wordpress中带有JQuery Accordion的未定义匿名函数
- 使用facebookconnect插件时不能调用未定义的分割