javascript - angular和地图插件的问题
PHPz
PHPz 2017-04-10 15:59:34
[JavaScript讨论组]

http://segmentfault.com/q/1010000002484757

这个问题感觉并没有说的太清楚。

引用高德地图的SDK就会有警告。
Failed to execute 'write' on 'Document': It isn't possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened.

像这种需要加载js,或者操作dom的插件,改怎么和angularjs一起用呢?

PHPz
PHPz

学习是最好的投资!

全部回复(2)
ringa_lee

异步JS加载和执行document.write时document已经close,这是错误的原因;document.open会重置整个document;应该修改代码用非document.write的DOM操作,比如.innerHTML和appendChild。

阿神

想要和angularjs搭配使用,需要自己封装成directive或者provide,可以看 angular-ui-googlemap 的封装

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习
PHP中文网抖音号
发现有趣的

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号