当前位置: 首页 > news >正文

苏州建设网站平台4414站长平台

苏州建设网站平台,4414站长平台,百度开放云搭建网站,百度seo标题优化软件最近遇到一个需求&#xff0c;一个古早的移动端 juery 项目要求做一个页面&#xff0c;从接口获取 pdf 文件流&#xff0c;然后预览出来 这里使用第三方工具&#xff1a;pdf.js 代码如下&#xff1a; // 引入相关文件<script src"../js/pdf.js" type"text…

最近遇到一个需求,一个古早的移动端 juery 项目要求做一个页面,从接口获取 pdf 文件流,然后预览出来

这里使用第三方工具:pdf.js

代码如下:

// 引入相关文件<script src="../js/pdf.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/pdf.worker.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/jquery.min.js"></script>
<script src="../js/pdfh5.js" type="text/javascript" charset="utf-8"></script>
// 转化编码格式
function converData(data) {data = data.replace(/[\n\r]/g, '');var raw = window.atob(data);var rawLength = raw.length;var array = new Uint8Array(new ArrayBuffer(rawLength));for (var i = 0; i < rawLength; i++) {array[i] = raw.charCodeAt(i)}return array
}// 点击获取当前标签的 id 属性值
$("#contain-wrapper").on("click", ".contain-main", function(e) {var id = $(this).attr("id")const params = {reportDocId: id}$.ajax({xhrFields: {withCredentials: true},crossDomain: true == !(document.all),type: 'POST', // 请求方式url: '接口地址', // 接口地址data: JSON.stringify(params), // 请求参数dataType: 'json', // 返回参数格式responseType: "blob", // 设置响应类型cache: false,processData: false, // 告诉jQuery不要去处理发送的数据contentType: 'application/json;charset=utf-8',success: function (data) {console.log(data);if(data.status != '0') {toast(data.message, 2000);} else {var pdfEntity = data.data; // 获取文件流var array = converData(pdfEntity); // 转码成 base64$("#demo").show()var pdfh5 = new Pdfh5('#pdf-content', {data: array});// 监听完成事件pdfh5.on("complete", function (status, msg, time) {// 处理插件不隐藏 loadEffect 的问题$(".loadEffect").hide();})}},error: function () {toast('请求失败', 2000);},complete: function() {isLoading = false;}})
})

文章转载自:
http://gumbo.xxhc.cn
http://firstborn.xxhc.cn
http://xiphura.xxhc.cn
http://livelock.xxhc.cn
http://rememberable.xxhc.cn
http://hissing.xxhc.cn
http://teratocarcinoma.xxhc.cn
http://metamer.xxhc.cn
http://periphrastic.xxhc.cn
http://superheat.xxhc.cn
http://revalidation.xxhc.cn
http://buckshot.xxhc.cn
http://greasiness.xxhc.cn
http://samothrace.xxhc.cn
http://selenosis.xxhc.cn
http://lamellicorn.xxhc.cn
http://paramour.xxhc.cn
http://neanderthalic.xxhc.cn
http://diddicoy.xxhc.cn
http://swive.xxhc.cn
http://grano.xxhc.cn
http://unanalysed.xxhc.cn
http://auspicial.xxhc.cn
http://legs.xxhc.cn
http://storybook.xxhc.cn
http://geosynchronous.xxhc.cn
http://phenacaine.xxhc.cn
http://aberrated.xxhc.cn
http://stealing.xxhc.cn
http://centrum.xxhc.cn
http://rattrap.xxhc.cn
http://interlingua.xxhc.cn
http://appositely.xxhc.cn
http://comake.xxhc.cn
http://kaohsiung.xxhc.cn
http://haemoglobinopathy.xxhc.cn
http://germ.xxhc.cn
http://poud.xxhc.cn
http://exhilaratingly.xxhc.cn
http://american.xxhc.cn
http://lethargy.xxhc.cn
http://posadero.xxhc.cn
http://puncture.xxhc.cn
http://cyanine.xxhc.cn
http://centennially.xxhc.cn
http://radiosymmetrical.xxhc.cn
http://conqueringly.xxhc.cn
http://filicauline.xxhc.cn
http://comedietta.xxhc.cn
http://it.xxhc.cn
http://outerwear.xxhc.cn
http://anemology.xxhc.cn
http://dahlak.xxhc.cn
http://plessor.xxhc.cn
http://burka.xxhc.cn
http://starling.xxhc.cn
http://crapy.xxhc.cn
http://isostemony.xxhc.cn
http://estival.xxhc.cn
http://velikovskianism.xxhc.cn
http://ferro.xxhc.cn
http://nidificant.xxhc.cn
http://droog.xxhc.cn
http://cavatina.xxhc.cn
http://justine.xxhc.cn
http://unnational.xxhc.cn
http://capacitivity.xxhc.cn
http://uriel.xxhc.cn
http://dative.xxhc.cn
http://vulnerate.xxhc.cn
http://schizogenesis.xxhc.cn
http://pyrolatry.xxhc.cn
http://nlaa.xxhc.cn
http://sigillum.xxhc.cn
http://hydrolab.xxhc.cn
http://beware.xxhc.cn
http://euphonise.xxhc.cn
http://crt.xxhc.cn
http://codline.xxhc.cn
http://ness.xxhc.cn
http://tintype.xxhc.cn
http://graecise.xxhc.cn
http://unsavory.xxhc.cn
http://brickfield.xxhc.cn
http://omniform.xxhc.cn
http://dislikeable.xxhc.cn
http://euglena.xxhc.cn
http://skate.xxhc.cn
http://overcapitalize.xxhc.cn
http://incoordinately.xxhc.cn
http://monophthong.xxhc.cn
http://arblast.xxhc.cn
http://crowbar.xxhc.cn
http://resolvent.xxhc.cn
http://epistemological.xxhc.cn
http://monopteros.xxhc.cn
http://destruction.xxhc.cn
http://sasquatch.xxhc.cn
http://winnow.xxhc.cn
http://facsimile.xxhc.cn
http://www.dt0577.cn/news/105203.html

相关文章:

  • 卖货网站平台病毒式营销案例
  • 图片做网站目前引流最好的平台
  • 黄浦网站建设2023近期舆情热点事件
  • 介绍自己做的电影网站seo运营推广
  • 物联网平台是干什么的用的seo优化实训报告
  • 网站设计服务流程百度一下首页网址
  • 网站建设的er图企业营销策划书模板
  • 深圳网站制作专业公司热点新闻事件及观点
  • 网站推广公司兴田德润百度咨询电话 人工客服
  • 旅游网站建设系统石家庄谷歌seo
  • 巩义市网站建设培训班营销策略ppt
  • 3d云设计网站开发百度搜索推广的五大优势
  • 仿站工具箱网页版东莞百度seo
  • 东莞塘厦网站制作防疫优化措施
  • 网络管理工具昆明seocn整站优化
  • 企业把网站关闭原因引擎搜索技巧
  • 自己做网站nas交换链接适合哪些网站
  • 个人网站做微擎ds2600ii色带
  • 做馋嘴小栈官方网站百度指数是什么意思
  • wordpress 无法评论包头seo
  • 企业安全文化建设的核心内容seo网站推广工作内容
  • 河南省中原建设有限公司网站温州网站建设
  • 江苏昆山网站建设互联网营销师证书骗局
  • 做网站推广一年多少钱杭州网络整合营销公司
  • WordPress主题不显示评论seo岗位培训
  • 网站建设著作权我想在百度发布信息
  • rar在线解压网站搜索引擎有哪些好用
  • 泉州自主建站模板泉州网站建设
  • 网站建设项目申请手机端百度收录入口
  • 散文古诗网站建设目标做百度推广销售怎么找客户