【发布时间】:2017-11-14 01:40:03
【问题描述】:
我有一个使用 console plugin 的 Cordova 7.0.1 项目,因此我可以在 iOS 上使用 console.log()。该插件一直有效,直到重定向,例如
window.location.href = 'index.html';
此时console.log() 停止工作,即使alert() 仍然有效。这很令人沮丧,因为此时应用程序没有响应(尝试登录),而且带有警报的调试很痛苦。
在 XCode 控制台中,我有以下内容:
2017-06-12 15:01:14.828 APP [x:x] Session validated
2017-06-12 15:01:14.835 APP [x:x] Resetting plugins due to page load.
2017-06-12 15:01:15.491 APP [x:x] Finished load of: file:///Users/X/Library/Developer/CoreSimulator/Devices/X/data/Containers/Bundle/Application/X/APP.app/www/index.html
“已验证的会话”是 console.logged。
【问题讨论】: