發表文章

目前顯示的是有「jQuery」標籤的文章

import excel ajax jquery

  function importSubmit() {     var config = layui.config;     //请求的数据是FormData类型     var formData = new FormData();     //获取上传的文件     formData.append("file",$("#file")[0].files[0]);     //url为文件读取的后台controller请求路径     var url = '###';     //ajax提交请求,注意data、contentType、processData和dataType的设置     $.ajax({         type: "POST",         url: url,         data: formData,         contentType: false,         processData:false,         dataType: "json",         success: function(resp_data) {             if (resp_data.resp_code==0){                 //js封装了admin对象                 var admin = layui.admin;               ...

[jQuery] excel to JSON

vv http://jsfiddle.net/d2atnbrt/5/ https://codertw.com/%E7%A8%8B%E5%BC%8F%E8%AA%9E%E8%A8%80/654366/ https://stackoverflow.com/questions/28782074/excel-to-json-javascript-code http://jsfiddle.net/d2atnbrt/5/ https://stackoverflow.com/questions/28782074/excel-to-json-javascript-code   ========== https://www.aspsnippets.com/Articles/Convert-Excel-to-JSON-using-jQuery.aspx https://codertw.com/%E7%A8%8B%E5%BC%8F%E8%AA%9E%E8%A8%80/654366/ https://github.com/YDulanjani/ConvertExcelToJSON/blob/master/convertExcelToJSON/medium1.html https://blog.bitsrc.io/csv-excel-to-json-in-javascript-70e61a1dc32d https://www.aspsnippets.com/Articles/Convert-Excel-to-JSON-using-jQuery.aspx V https://medium.com/swlh/how-to-convert-excel-data-into-json-object-using-javascript-1c4e0d3e97ee

[js] import file

圖片
https://www.youtube.com/watch?v=kJT-iMYMPKg&ab_channel=neilscodetutorials <script src=".../jquery.min.js"></script> <div id="buttondiv" >   <input type="file" id="inputfile" />   <input type="button" id="viewfile" value="Import file" /> </div> <div class="container" id="container">   <table class="gridtable" id="tableMain">     <thead>        <tr class="tableheader">           <th> column1</th>           <th> column2</th>           <th> column3</th>           <th> column4</th>        </tr>      </thead>   </table> </div> <script>    $(document).ready(function(){      $('#viewfile').click(function(){          var rdr ...

jQuery file download

  http://samchu.logdown.com/posts/430528-easy-use-jquery-filedownload https://github.com/johnculviner/jquery.fileDownload/blob/master/src/Scripts/jquery.fileDownload.js $ . fileDownload ( "picCustom.do" ,   { httpMethod : "POST" , data : { act : "downloadZipImages" , jsonstr : JSON . stringify ( jsonObj )} }); 後端部分 public ModelAndView downloadZipImages ( HttpServletRequest request , HttpServletResponse response ) throws PGException { String regEx = "[/\\\\:*?\"<>|]" ; Pattern pattern = Pattern . compile ( regEx ); Matcher matcher = null ; try { request . setCharacterEncoding ( "UTF-8" ); String jsonstr = org . apache . commons . lang . StringUtils . trimToNull ( request . getParameter ( "jsonstr" )); String jsonstrrep = jsonstr . replaceAll ( "," , "," ); JSONO...