Native调JS:loadUrl JS函数字符串- WebView.loadUrl("javascript:functionName()")

博客介绍了Native调用JS的方式,通过WebView.loadUrl执行JS函数字符串,如WebView.loadUrl(\javascript:functionName()\),这是前端开发中实现Native与JS交互的重要手段。
   
mapbox-gl.js:31 Kr: Not Found at mapbox-gl.js:31:73019 fire @ mapbox-gl.js:31 (匿名) @ mapbox-gl.js:45 h @ mapbox-gl.js:45 (匿名) @ mapbox-gl.js:45 (匿名) @ mapbox-gl.js:31 Promise.then u @ mapbox-gl.js:31 (匿名) @ mapbox-gl.js:31 Hr @ mapbox-gl.js:31 push../node_modules/mapbox-gl/dist/mapbox-gl.js.t.g @ mapbox-gl.js:41 _spriteRequest._spriteRequest @ mapbox-gl.js:45 _loadSprite @ mapbox-gl.js:45 _load @ mapbox-gl.js:45 (匿名) @ mapbox-gl.js:45 (匿名) @ mapbox-gl.js:31 Promise.then c @ mapbox-gl.js:31 (匿名) @ mapbox-gl.js:31 Promise.then u @ mapbox-gl.js:31 (匿名) @ mapbox-gl.js:31 Hr @ mapbox-gl.js:31 push../node_modules/mapbox-gl/dist/mapbox-gl.js.t.g @ mapbox-gl.js:41 loadURL @ mapbox-gl.js:45 load @ mapbox-gl.js:45 _updateStyle @ mapbox-gl.js:45 setStyle @ mapbox-gl.js:45 Map @ mapbox-gl.js:45 initMap @ index.vue:70 mounted @ index.vue:64 invokeWithErrorHandling @ vue.runtime.esm.js:1854 callHook @ vue.runtime.esm.js:4213 insert @ vue.runtime.esm.js:3139 invokeInsertHook @ vue.runtime.esm.js:6340 patch @ vue.runtime.esm.js:6559 Vue._update @ vue.runtime.esm.js:3942 updateComponent @ vue.runtime.esm.js:4060 get @ vue.runtime.esm.js:4473 run @ vue.runtime.esm.js:4548 flushSchedulerQueue @ vue.runtime.esm.js:4304 (匿名) @ vue.runtime.esm.js:1980 flushCallbacks @ vue.runtime.esm.js:1906 Promise.then timerFunc @ vue.runtime.esm.js:1933 nextTick @ vue.runtime.esm.js:1990 queueWatcher @ vue.runtime.esm.js:4396 update @ vue.runtime.esm.js:4538 notify @ vue.runtime.esm.js:730 reactiveSetter @ vue.runtime.esm.js:1055 (匿名) @ vue-router.esm.js:2503 (匿名) @ vue-router.esm.js:2502 updateRoute @ vue-router.esm.js:1989 (匿名) @ vue-router.esm.js:1867 (匿名) @ vue-router.esm.js:1976 step @ vue-router.esm.js:1706 step @ vue-router.esm.js:1713 step @ vue-router.esm.js:1713 runQueue @ vue-router.esm.js:1717 (匿名) @ vue-router.esm.js:1971 step @ vue-router.esm.js:1706 (匿名) @ vue-router.esm.js:1710 (匿名) @ vue-router.esm.js:1956 (匿名) @ vue-router.esm.js:1749 (匿名) @ vue-router.esm.js:1825 (匿名) @ permission.js:108 Promise.then component @ permission.js:108 (匿名) @ vue-router.esm.js:1766 (匿名) @ vue-router.esm.js:1793 (匿名) @ vue-router.esm.js:1793 flatMapComponents @ vue-router.esm.js:1792 (匿名) @ vue-router.esm.js:1728 iterator @ vue-router.esm.js:1935 step @ vue-router.esm.js:1709 step @ vue-router.esm.js:1713 step @ vue-router.esm.js:1713 (匿名) @ vue-router.esm.js:1710 (匿名) @ vue-router.esm.js:1956 _callee$ @ permission.js:100 tryCatch @ regeneratorRuntime.js:45 (匿名) @ regeneratorRuntime.js:133 (匿名) @ regeneratorRuntime.js:74 asyncGeneratorStep @ asyncToGenerator.js:3 _next @ asyncToGenerator.js:17 (匿名) @ asyncToGenerator.js:22 (匿名) @ asyncToGenerator.js:14 (匿名) @ permission.js:176 iterator @ vue-router.esm.js:1935 step @ vue-router.esm.js:1709 runQueue @ vue-router.esm.js:1717 confirmTransition @ vue-router.esm.js:1964 transitionTo @ vue-router.esm.js:1866 replace @ vue-router.esm.js:2279 (匿名) @ vue-router.esm.js:1950 _callee$ @ permission.js:155 tryCatch @ regeneratorRuntime.js:45 (匿名) @ regeneratorRuntime.js:133 (匿名) @ regeneratorRuntime.js:74 asyncGeneratorStep @ asyncToGenerator.js:3 _next @ asyncToGenerator.js:17 Promise.then asyncGeneratorStep @ asyncToGenerator.js:8 _next @ asyncToGenerator.js:17 Promise.then asyncGeneratorStep @ asyncToGenerator.js:8 _next @ asyncToGenerator.js:17 Promise.then asyncGeneratorStep @ asyncToGenerator.js:8 _next @ asyncToGenerator.js:17 Promise.then asyncGeneratorStep @ asyncToGenerator.js:8 _next @ asyncToGenerator.js:17 (匿名) @ asyncToGenerator.js:22 (匿名) @ asyncToGenerator.js:14 (匿名) @ permission.js:176 iterator @ vue-router.esm.js:1935 step @ vue-router.esm.js:1709 runQueue @ vue-router.esm.js:1717 confirmTransition @ vue-router.esm.js:1964 transitionTo @ vue-router.esm.js:1866 init @ vue-router.esm.js:2494 beforeCreate @ vue-router.esm.js:539 invokeWithErrorHandling @ vue.runtime.esm.js:1854 callHook @ vue.runtime.esm.js:4213 Vue._init @ vue.runtime.esm.js:4998 Vue @ vue.runtime.esm.js:5079 ./src/main.js @ main.js:75 __webpack_require__ @ bootstrap:766 fn @ bootstrap:129 1 @ app.js:297546 __webpack_require__ @ bootstrap:766 (匿名) @ bootstrap:901 (匿名) @ bootstrap:901
最新发布
08-26
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值