由于表格数据中含有中文导致的,在网页的开发者选项中报一个 Uncaught INVALID_CHARACTER_ERR: DOM Exception 5 问题。这个问题是由于BootStrap table 默认不支持中文,只会识别 ASCII字符,为了让bootstrap table 识别出中文,我们需要扩展版的 jQuery.base64.js 插件,让其可以识别出unicode 字符。

解决该问题的方法时,将默认的jquery.base64.js 文件内容替换成下面提供的扩展版:

jQuery.base64 = (function($) {// private propertyvar keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";// private method for UTF-8 encodingfunction utf8Encode(string) {string = string.replace(/\r\n/g,"\n");var utftext = "";for (var n = 0; n < string.length; n++) {var c = string.charCodeAt(n);if (c < 128) {utftext += String.fromCharCode(c);}else if((c > 127) && (c < 2048)) {utftext += String.fromCharCode((c >> 6) | 192);utftext += String.fromCharCode((c & 63) | 128);}else {utftext += String.fromCharCode((c >> 12) | 224);utftext += String.fromCharCode(((c >> 6) & 63) | 128);utftext += String.fromCharCode((c & 63) | 128);}}return utftext;}function encode(input) {var output = "";var chr1, chr2, chr3, enc1, enc2, enc3, enc4;var i = 0;input = utf8Encode(input);while (i < input.length) {chr1 = input.charCodeAt(i++);chr2 = input.charCodeAt(i++);chr3 = input.charCodeAt(i++);enc1 = chr1 >> 2;enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);enc4 = chr3 & 63;if (isNaN(chr2)) {enc3 = enc4 = 64;} else if (isNaN(chr3)) {enc4 = 64;}output = output +keyStr.charAt(enc1) + keyStr.charAt(enc2) +keyStr.charAt(enc3) + keyStr.charAt(enc4);}return output;}return {encode: function (str) {return encode(str);}};}(jQuery));

乱码问题(xml乱码)

待解决

转载于:https://www.cnblogs.com/cnsdhzzl/p/6956255.html

bootstrap table导出功能无效报错Uncaught INVALID_CHARACTER_ERR: DOM Exception 5和导出中文乱码问题...相关推荐

  1. echarts报错Uncaught SyntaxError: Unexpected token ‘<‘

    问题重现 最近需要研究echarts做图表,打算在html中先引用echarts试试. 于是百度到echarts官网的教程:5 分钟上手 ECharts <!DOCTYPE html> & ...

  2. react报错 Uncaught Invariant Violation: Unable to find node on an unmounted compone

    react报错 Uncaught Invariant Violation: Unable to find node on an unmounted compone 在采用ant.design的Tabl ...

  3. html表格右键可编辑,Bootstrap table右键功能实现方法

    最近遇到有一个需求,需要在Bootstrap table上使用右键.网上搜了半天没有找到,最后发现Bootstrap table不支持右键(官方文档给出的答案 https://github.com/w ...

  4. 小程序组件报错Uncaught TypeError: Cannot read property 'name' of undefined

    小程序组件报错Uncaught TypeError: Cannot read property 'name' of undefined Component({/*** 组件的属性列表*/propert ...

  5. vue报错 Uncaught (in promise) NavigationDuplicated {_name:““NavigationDuplicated“... 的解决方法

    vue报错 Uncaught (in promise) NavigationDuplicated {_name:""NavigationDuplicated"... 的解 ...

  6. JS报错: Uncaught SyntaxError: Invalid shorthand property initializer

    JS报错: Uncaught SyntaxError: Invalid shorthand property initializer 如果你的代码报错以上提示, 那么就去检查一下, 对应的代码是不是把 ...

  7. js代码中for循环里绑定onclick事件报错Uncaught TypeError Cannot set properties of undefined (setting ‘className‘)

    jsfor循环里绑定onclick事件报错Uncaught TypeError Cannot set properties of undefined (setting 'className') 我想要 ...

  8. 05_SQL注入_功能语句报错注入盲注

    05_SQL注入_功能语句&报错回显&盲注 1. SQL 语句和网站功能 1.1 Web开发中常见语句 [本章代码来源于pikachu和sqli-lab中的靶场] 开发中,根据不同的需 ...

  9. 【解决】控制台报错Uncaught TypeError: Object(...) is not a function at eval (vue-router.esm-bundler.js

    打开http://localhost:8080/,控制台报错 Uncaught TypeError: Object(...) is not a functionat eval (vue-router. ...

  10. 谷歌学术导出参考文献(BibTeX)报错 403

    解决方法 在百度学术(https://xueshu.baidu.com/)上搜索论文的题目,然后导出BibTeX 问题解析 在google scholar里导出bibtex参考文献报错403,显示的是 ...

最新文章

  1. fun python_Python(一)
  2. 计算机网络ieee,博士生程珂论文连续两年被计算机网络顶级会议IEEE INFOCOM录用...
  3. 手眼标定eye-to-hand 示例:handeye_stationarycam_calibration
  4. 拓端tecdat|数据观察“双十一”网购新常态
  5. 找零钱问题系列之记忆搜索
  6. shp地图如何导入奥维地图手机_奥维地图如何导入文件 奥维地图导出文件在哪...
  7. 开源免费语音识别引擎 RapidASR
  8. 小米推送,华为推送,个推,阿里云推送集成(服务端JAVA开发)
  9. python网课 知乎_如何看待风变编程的 Python 网课
  10. 点赞 分数 20作者 陈越单位 浙江大学
  11. 理解openssl协议:x509、crt、cer、key、csr、ssl、tls 这些都是什么鬼? 如何给自己网站颁发证书?
  12. Web APIs 简介
  13. Android第三方支付
  14. Python.对鸢尾花数据集进行可视化操作,对数据分析
  15. 电子作业票如何实现特殊作业全过程信息化管理
  16. java for coun,为什么程序中的一段for循环没有被执行
  17. 小学数学计算机整合课后反思,2020小学数学教研组工作总结_小学数学教学反思心得五篇...
  18. 实现HTML页面动态处理
  19. 个人电商项目(mxcmall)的环境配置
  20. php--生成excel的个人简历

热门文章

  1. 一站式学习 Linux C语言编程
  2. C/C++中static与const的区别与联系
  3. 「三分钟系列02」3分钟看懂最高效的快速排序分析与优化
  4. Scala: 简介和安装
  5. 照着教程装oracle却报错,手把手演示win7系统安装oracle10g程序遇到“程序异常终止。发生内部错误...”的操作教程...
  6. 6个座位办公室最佳位置_6个办公室座位的最佳位置 六个最好的办公室座位位置...
  7. html+css如何提升,用好这20个css技巧快速提升你的CSS技能
  8. Flutter学习 — 实现滑动关闭、删除item
  9. Java学习笔记四——运算符
  10. 第一周 7.10-7.16