Comments (4)
@guduchina chrome下确实不行,我是用360极速浏览器没问题。chrome这边可能是事件兼容性的问题,我有时间再具体研究,到时候会通知你,感谢反馈
from local-kitymind.
我实在是找不到其他的方法了。。。。。
高版本的chrome下确实不行,不过52版本的chrome貌似可以。
我改了下导出的方法,创建了一个a链接,点击可下载文件,多了一步。
`// 由于chrome较高版本中无法实现自动触发event,所以改用以下方法进行导出
var fileName = $('#node_text1').text()+'.'+type;
var aLink = document.createElement('a');
// 点击后自动删除当前a标签
aLink.onclick = function() {
$(this).remove();
};
var node = document.createTextNode(fileName);
aLink.appendChild(node);
var blob = new Blob([content]);
aLink.download = fileName;
aLink.href = URL.createObjectURL(blob);
$('.editor-title').append(aLink);`
from local-kitymind.
@guduchina chrome的机制是阻止代码触发的页面点击事件,据说是为了防止广告,之前听说一个办法是设置setTimeout延时执行代码模拟的点击事件。
from local-kitymind.
@guduchina 使用了很奇葩的方式hack了chrome浏览器的限制,仅供参考
from local-kitymind.
Related Issues (7)
- 大神,你好 HOT 1
- 关于你脑图的二次开发想向您请教 HOT 3
- 百度脑图
- 插入本地图片功能不能用,请问怎么班
- 你的代码怎么跑起来能写下详细步骤吗
- 怎么导出为图片 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from local-kitymind.