vue-loader 上传文件vue-file-upload 经验

vue-file-upload vue.js ,vue-loader 上传文件vue-file-upload 代码里面包含demo,运行: npm run dev install npm npm

jopen 2016-01-02   335997   0

php限制上传文件类型并保存上传文件 代码段

下面的代码演示了php中如何获取用户上传文件,并限制文件类型的一般图片文件,最后保存到服务器

cxx3 2015-04-26   893   0
PHP  

jsupload实现js上传文件,并显示文件上传进度 经验

在传统的文件上传过程中,要想达到更好的客户体验一般是选择Flash来实现的。但是随着 Web 2.0 应用技术的不断发展,JavaScript 正在扮演越来越重要的角色,现在已经可以用JavaScri

fmms 2012-01-30   160971   0

php上传文件并显示上传进度 代码段

记得上传文件的时候要大点,不然还没看出来就上传完了,并且上传文件不要太大,上G的就算了,2G的我试了,PHP受不了,我测试的是300多M的,记得要调整小php.ini参数啊 “选文件=》提交=》获取信息”要一气呵成哦^

xm52 2015-05-08   1059   0
PHP  

php文件上传 代码段

$filepath; //指定上传文件保存的路径 private $allowtype=array('gif', 'jpg', 'png', 'jpeg'); //充许上传文件的类型 private $maxsize=1000000;

b573 2015-01-24   4292   0
PHP  

php curl 上传文件 代码段

假设server端上传文件处理脚本upload.php: 文件是utf8

KelDandridg 2016-01-22   1690   0
PHP  

Spring MVC 的文件上传 经验

在spring的applicationContext.xml中配置: jopen 2012-09-05   105397   0

Ajax实现文件上传 经验

Ajax实现文件上传

jopen 2013-01-29   129405   0

php上传文件 经验

;//设置存放文件的目录 var $max_size;//上传文件的大小 var $event; //初始值是success var $filename;//获取保存在文件夹里的文件文件名字 function

jopen 2012-12-12   13843   0
PHP开发   PHP  

利用SpringMVC上传文件 代码段

利用SpringMVC上传文件,也可以一次上传多个文件上传多个文件的时候用MultipartFile[] file即可 页面表单 Upload a</p></div> <div class="meta"> <a class="aut" data-avatar="https://static.open-open.com/img/avatar/privary/default.png" data-avatar="https://static.open-open.com/img/avatar/privary/default.png" data-name=" m4ed " data-id="471247" href="https://user.open-open.com/u/471247"> <img src="https://static.open-open.com/img/avatar/privary/default.png" width="24"> m4ed </a> <span class="t"> <i class="fa fa-clock-o"></i> 2015-01-31 </span>  <span class="number">2923 <i aria-hidden="true" class="fa fa-eye"></i></span>  <span class="number">0 <i aria-hidden="true" class="fa fa-thumbs-o-up"></i></span> <div class=" float-right ui-tags"> <a class="" href="/code/tag/springmvc.html">SpringMVC</a>   </div> </div> </div> </div> <div class="item ut-pd10 "> <div class="content ut-pl15"> <h2 class="header"> <a href="/code/view/1423558885014" target="_blank"> 使用SpringMVC<em>上传</em><em>文件</em></a> <span class="con-type">代码段</span> </h2> <div class="description"><p>页面控件的<em>文件</em>流 **/ MultipartFile multipartFile = multipartRequest.getFile("file"); /** 获取<em>文件</em>的后缀,防止别人传可执行<em>文件</em> **/</p></div> <div class="meta"> <a class="aut" data-avatar="https://static.open-open.com/img/avatar/privary/default.png" data-avatar="https://static.open-open.com/img/avatar/privary/default.png" data-name=" gbd8 " data-id="472040" href="https://user.open-open.com/u/472040"> <img src="https://static.open-open.com/img/avatar/privary/default.png" width="24"> gbd8 </a> <span class="t"> <i class="fa fa-clock-o"></i> 2015-02-10 </span>  <span class="number">3738 <i aria-hidden="true" class="fa fa-eye"></i></span>  <span class="number">0 <i aria-hidden="true" class="fa fa-thumbs-o-up"></i></span> <div class=" float-right ui-tags"> <a class="" href="/code/tag/springmvc.html">SpringMVC</a>   </div> </div> </div> </div> <div class="item ut-pd10 "> <div class="content ut-pl15"> <h2 class="header"> <a href="/code/view/1426581281539" target="_blank"> PHP <em>文件</em><em>上传</em>示例</a> <span class="con-type">代码段</span> </h2> <div class="description"><p><html> <head> <title>File Uploader</title> </head> <body> <h3>File Upload</h3> Select a file to upload:<br> <form action="uploader.php" method="post" enctype="multipart/form-data"> <input type="file" </p></div> <div class="meta"> <a class="aut" data-avatar="https://static.open-open.com/img/avatar/privary/default.png" data-avatar="https://static.open-open.com/img/avatar/privary/default.png" data-name=" phpde " data-id="474482" href="https://user.open-open.com/u/474482"> <img src="https://static.open-open.com/img/avatar/privary/default.png" width="24"> phpde </a> <span class="t"> <i class="fa fa-clock-o"></i> 2015-03-17 </span>  <span class="number">950 <i aria-hidden="true" class="fa fa-eye"></i></span>  <span class="number">0 <i aria-hidden="true" class="fa fa-thumbs-o-up"></i></span> <div class=" float-right ui-tags"> <a class="" href="/code/tag/php.html">PHP</a>   </div> </div> </div> </div> <div class="item ut-pd10 "> <div class="content ut-pl15"> <h2 class="header"> <a href="/code/view/1455065414136" target="_blank"> python<em>上传</em>ftp<em>文件</em></a> <span class="con-type">代码段</span> </h2> <div class="description"><p>#encoding=utf8 from ftplib import FTP #加载ftp模块 IP = '103.240.150.104' user = 'webmaster@stchat.cn' password = '5' filename = 'zhihu.html' path = '/root/Desktop/zhihu.html' ftp=FTP() #设置变量 ftp.set_debu</p></div> <div class="meta"> <a class="aut" data-avatar="https://static.open-open.com/img/avatar/privary/default.png" data-avatar="https://static.open-open.com/img/avatar/privary/default.png" data-name=" Dac32U " data-id="414413" href="https://user.open-open.com/u/414413"> <img src="https://static.open-open.com/img/avatar/privary/default.png" width="24"> Dac32U </a> <span class="t"> <i class="fa fa-clock-o"></i> 2016-02-09 </span>  <span class="number">1006 <i aria-hidden="true" class="fa fa-eye"></i></span>  <span class="number">0 <i aria-hidden="true" class="fa fa-thumbs-o-up"></i></span> <div class=" float-right ui-tags"> <a class="" href="/code/tag/python.html">Python</a>   </div> </div> </div> </div> <div class="item ut-pd10 "> <div class="content ut-pl15"> <h2 class="header"> <a href="/blog/5035947833217755238.html" target="_blank"> Android HttpClient<em>上传</em><em>文件</em></a> <span class="con-type">博客</span> </h2> <div class="description"><p>Android HttpClient<em>上传</em><em>文件</em>  的一个封装方法。里面有一小段代码是处理获取JSON格式数据 System.out.println("executing request " + httppost</p></div> <div class="meta"> <a class="aut" data-avatar="https://simg.open-open.com/show/6d6535a951084d1d26775d0c7af02397.jpg" data-avatar="https://simg.open-open.com/show/6d6535a951084d1d26775d0c7af02397.jpg" data-name=" fanlix " data-id="142488" href="https://user.open-open.com/u/142488"> <img src="https://simg.open-open.com/show/6d6535a951084d1d26775d0c7af02397.jpg" width="24"> fanlix </a> <span class="t"> <i class="fa fa-clock-o"></i> 2012-10-13 </span>  <span class="number">4947 <i aria-hidden="true" class="fa fa-eye"></i></span>  <span class="number">0 <i aria-hidden="true" class="fa fa-thumbs-o-up"></i></span> <div class=" float-right ui-tags"> <a class="" href="/blog/tag/1-8-banben-fabu.html">1.8版本发布</a>   <a class="" href="/blog/tag/wendang-yanshi.html">文档演示</a>   </div> </div> </div> </div> <div class="item ut-pd10 "> <div class="content ut-pl15"> <h2 class="header"> <a href="/lib/view/open1339561488037.html" target="_blank"> Rails<em>文件</em><em>上传</em> carrierwave</a> <span class="con-type">经验</span> </h2> <div class="description"><p>carrierwave 是 Rails 的一个扩展用来提供简单而且灵活的<em>文件</em><em>上传</em>处理,可以跟基于 Rack 的 Web 应用良好集成。 示例代码: uploader = AvatarUploader</p></div> <div class="meta"> <a class="aut" data-avatar="https://simg.open-open.com/show/aea357384dd8fef6933d5f6f116c5509.jpg" data-avatar="https://simg.open-open.com/show/aea357384dd8fef6933d5f6f116c5509.jpg" data-name=" openkk " data-id="361" href="https://user.open-open.com/u/361"> <img src="https://simg.open-open.com/show/aea357384dd8fef6933d5f6f116c5509.jpg" width="24"> openkk </a> <span class="t"> <i class="fa fa-clock-o"></i> 2012-06-13 </span>  <span class="number">23499 <i aria-hidden="true" class="fa fa-eye"></i></span>  <span class="number">0 <i aria-hidden="true" class="fa fa-thumbs-o-up"></i></span> <div class=" float-right ui-tags"> <a class="" href="/lib/tag/rails.html">Rails</a>   <a class="" href="/lib/tag/wenjian-shangchuan.html">文件上传</a>   </div> </div> </div> </div> <div class="item ut-pd10 "> <div class="content ut-pl15"> <h2 class="header"> <a href="/lib/view/open1366690619468.html" target="_blank"> 关于httpClient<em>上传</em><em>文件</em></a> <span class="con-type">经验</span> </h2> <div class="description"><p>最近要做客户端<em>上传</em>图片和参数,服务器整合了SSH . 废话不多说,上代码 客户端: import java.io.File; import java.io.InputStream; import</p></div> <div class="meta"> <a class="aut" data-avatar="https://simg.open-open.com/show/41771eadd463a28f6b623f3d3775f8fe.jpg" data-avatar="https://simg.open-open.com/show/41771eadd463a28f6b623f3d3775f8fe.jpg" data-name=" jopen " data-id="37924" href="https://user.open-open.com/u/37924"> <img src="https://simg.open-open.com/show/41771eadd463a28f6b623f3d3775f8fe.jpg" width="24"> jopen </a> <span class="t"> <i class="fa fa-clock-o"></i> 2013-04-23 </span>  <span class="number">32520 <i aria-hidden="true" class="fa fa-eye"></i></span>  <span class="number">0 <i aria-hidden="true" class="fa fa-thumbs-o-up"></i></span> <div class=" float-right ui-tags"> <a class="" href="/lib/tag/wenjian-shangchuan.html">文件上传</a>   <a class="" href="/lib/tag/httpclient.html">HttpClient</a>   </div> </div> </div> </div> <div class="item ut-pd10 "> <div class="rank border ut-120-170"> <img class="lazy" src="https://static.open-open.com/img/wdfm.png" data-original="https://sdoc.open-open.com/image/4c7a0f777101d4d7f8ec8a72a3b85f46_thumb.jpg" > <span class="label ">P4</span> </div> <div class="content ut-pl15"> <h2 class="header"> <a href="/doc/3a69a65c72a343b3a05bc901d31e0ab0.html" target="_blank"><i class="fa fa-file-word-o" aria-hidden="true"></i>  httpClient <em>上传</em><em>文件</em></a> <span class="con-type">文档</span> </h2> <div class="description"><p>httpClient<em>上传</em><em>文件</em> ApacheServlet  注意:要载入commons-httpclient-3.1.jar commons-codec.jar commons-logging.jar这三个包</p></div> <div class="meta"> <a class="aut" data-avatar="https://static.open-open.com/img/avatar/privary/default.png" data-avatar="https://static.open-open.com/img/avatar/privary/default.png" data-name=" airongjun " data-id="126950" href="https://user.open-open.com/u/126950"> <img src="https://static.open-open.com/img/avatar/privary/default.png" width="24"> airongjun </a> <span class="t"> <i class="fa fa-clock-o"></i> 2013-04-18 </span>  <span class="number">699 <i aria-hidden="true" class="fa fa-eye"></i></span>  <span class="number">0 <i aria-hidden="true" class="fa fa-thumbs-o-up"></i></span> <div class=" float-right ui-tags"> <a class="" href="/wenku/tag/wenjian-shangchuan.html">文件上传</a>   </div> </div> </div> </div> <div class="item ut-pd10 "> <div class="rank border ut-120-170"> <img class="lazy" src="https://static.open-open.com/img/wdfm.png" data-original="https://sdoc.open-open.com/image/ed36f9a335f3100b331d04a19df0d9d4_thumb.jpg" > <span class="label ">P7</span> </div> <div class="content ut-pl15"> <h2 class="header"> <a href="/doc/3b4f8f170b484604a2fde4eb20bf96bf.html" target="_blank"><i class="fa fa-file-word-o" aria-hidden="true"></i>  Java<em>文件</em><em>上传</em></a> <span class="con-type">文档</span> </h2> <div class="description"><p><em>文件</em><em>上传</em>的简单方法:(原理性的实验) 1. 附件: 2. public void doPost(HttpServletRequest request, HttpServletResponse response)</p></div> <div class="meta"> <a class="aut" data-avatar="https://static.open-open.com/img/avatar/privary/default.png" data-avatar="https://static.open-open.com/img/avatar/privary/default.png" data-name=" comers " data-id="10396" href="https://user.open-open.com/u/10396"> <img src="https://static.open-open.com/img/avatar/privary/default.png" width="24"> comers </a> <span class="t"> <i class="fa fa-clock-o"></i> 2011-01-25 </span>  <span class="number">993 <i aria-hidden="true" class="fa fa-eye"></i></span>  <span class="number">0 <i aria-hidden="true" class="fa fa-thumbs-o-up"></i></span> <div class=" float-right ui-tags"> <a class="" href="/wenku/tag/java-kaifa.html">Java开发</a>   <a class="" href="/wenku/tag/java.html">Java</a>   </div> </div> </div> </div> <div class="item ut-pd10 "> <div class="content ut-pl15"> <h2 class="header"> <a href="/code/view/1423642542529" target="_blank"> PHP<em>文件</em><em>上传</em>示例</a> <span class="con-type">代码段</span> </h2> <div class="description"><p>et=UTF-8'); //准备接收 /* echo '<em>文件</em>名:'.$_FILES['userfile']['name']; echo '<em>文件</em>大小:'.$_FILES['userfile']['size'];</p></div> <div class="meta"> <a class="aut" data-avatar="https://static.open-open.com/img/avatar/privary/default.png" data-avatar="https://static.open-open.com/img/avatar/privary/default.png" data-name=" ww24 " data-id="472139" href="https://user.open-open.com/u/472139"> <img src="https://static.open-open.com/img/avatar/privary/default.png" width="24"> ww24 </a> <span class="t"> <i class="fa fa-clock-o"></i> 2015-02-11 </span>  <span class="number">1091 <i aria-hidden="true" class="fa fa-eye"></i></span>  <span class="number">0 <i aria-hidden="true" class="fa fa-thumbs-o-up"></i></span> <div class=" float-right ui-tags"> <a class="" href="/code/tag/php.html">PHP</a>   </div> </div> </div> </div> <div class="item ut-pd10 "> <div class="content ut-pl15"> <h2 class="header"> <a href="/code/view/1426690510617" target="_blank"> PHP 多<em>文件</em><em>上传</em></a> <span class="con-type">代码段</span> </h2> <div class="description"><p>class="easyui-linkbutton" icon="icon-add" id="uploadImage_input">图片<em>上传</em></a> </form> ** 注意name的写法,都要使用name[]方式,并且用同一个name</p></div> <div class="meta"> <a class="aut" data-avatar="https://static.open-open.com/img/avatar/privary/default.png" data-avatar="https://static.open-open.com/img/avatar/privary/default.png" data-name=" cmb2 " data-id="474628" href="https://user.open-open.com/u/474628"> <img src="https://static.open-open.com/img/avatar/privary/default.png" width="24"> cmb2 </a> <span class="t"> <i class="fa fa-clock-o"></i> 2015-03-18 </span>  <span class="number">1201 <i aria-hidden="true" class="fa fa-eye"></i></span>  <span class="number">0 <i aria-hidden="true" class="fa fa-thumbs-o-up"></i></span> <div class=" float-right ui-tags"> <a class="" href="/code/tag/php.html">PHP</a>   </div> </div> </div> </div> </section> <div class="usage-search clearfix"> <h2 class="" aria-label=""><strong>vue文件上传</strong> 的相关搜索</h2> <div > <ul class="float-left"> <li><a href="https://www.open-open.com/search/?kw=JavaScript教程" ><em>JavaScript</em>教程</a></li> <li><a href="https://www.open-open.com/search/?kw=JavaScript、jQuery、HTML5、Node.js实例大全" ><em>JavaScript</em>、jQuery、HTML5、Node.js实例大全</a></li> <li><a href="https://www.open-open.com/search/?kw=JavaScript中Array方法的正确打开方式" ><em>JavaScript</em>中Array方法的正确打开方式</a></li> <li><a href="https://www.open-open.com/search/?kw=JavaScript进阶学习" ><em>JavaScript</em>进阶学习</a></li> <li><a href="https://www.open-open.com/search/?kw=JavaScript动态创建多个div" ><em>JavaScript</em>动态创建多个div</a></li></ul> <ul class="float-left"> <li><a href="https://www.open-open.com/search/?kw=JavaScript�հ�" ><em>JavaScript</em>�հ�</a></li> <li><a href="https://www.open-open.com/search/?kw=JavaScript打印机" ><em>JavaScript</em>打印机</a></li> <li><a href="https://www.open-open.com/search/?kw=JavaScript濠㈠湱澧楅弲銉︽偿?Jsfx" ><em>JavaScript</em>濠㈠湱澧楅弲銉︽偿?Jsfx</a></li> <li><a href="https://www.open-open.com/search/?kw=Ember.Js v2.14.0-beta.1 发布,一个JavaScript框架" >Ember.Js v2.14.0-beta.1 发布,一个<em>JavaScript</em>框架</a></li> <li><a href="https://www.open-open.com/search/?kw=jQuery JavaScript与CSS开发入门经典" >jQuery <em>JavaScript</em>与CSS开发入门经典</a></li> </ul> </div> </div> <div class="ui-pagination clearfix"> <strong>1</strong> <a href=https://www.open-open.com/search/?kw=vue%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0&page=2>2</a> <a href=https://www.open-open.com/search/?kw=vue%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0&page=3>3</a> <a href=https://www.open-open.com/search/?kw=vue%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0&page=4>4</a> <a href=https://www.open-open.com/search/?kw=vue%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0&page=5>5</a> <a href=https://www.open-open.com/search/?kw=vue%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0&page=6>6</a> <a href=https://www.open-open.com/search/?kw=vue%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0&page=7>7</a> <a href=https://www.open-open.com/search/?kw=vue%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0&page=8>8</a> <a href=https://www.open-open.com/search/?kw=vue%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0&page=9>9</a> <a href=https://www.open-open.com/search/?kw=vue%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0&page=10>10</a> <a href=https://www.open-open.com/search/?kw=vue%E6%96%87%E4%BB%B6%E4%B8%8A%E4%BC%A0&page=2 class='pg-next'><i class='fa fa-angle-right'></i></a> </div> </div> <div class="col-md-3"> <div class=" ui-box ut-pd20"> <div class="title"><h3>关键词</h3></div> <p class="tags mt10"> <a class="" href="/wenku/?tags=JavaScript">JavaScript</a> <a class="" href="/wenku/?tags=Python">Python</a> <a class="" href="/wenku/?tags=PHP">PHP</a> <a class="" href="/wenku/?tags=Java">Java</a> <a class="" href="/wenku/?tags=Ajax">Ajax</a> <a class="" href="/wenku/?tags=Rails">Rails</a> <a class="" href="/wenku/?tags=Web框架">Web框架</a> <a class="" href="/wenku/?tags=文件上传">文件上传</a> <a class="" href="/wenku/?tags=Spring MVC">Spring MVC</a> <a class="" href="/wenku/?tags=PHP开发">PHP开发</a> <a class="" href="/wenku/?tags=1.8版本发布">1.8版本发布</a> <a class="" href="/wenku/?tags=Java开发">Java开发</a> <a class="" href="/wenku/?tags=文档演示">文档演示</a> <a class="" href="/wenku/?tags=SpringMVC">SpringMVC</a> <a class="" href="/wenku/?tags=HttpClient">HttpClient</a> <a class="" href="/wenku/?tags=vue-file-upload">vue-file-upload</a> </p> </div> </div> </div> </div> </div> </div> <footer > <div class="container py-5"> <div class="row"> <div class="col-md-3"> <h5>社区</h5> <div class="row"><div class="col-md-6"><a class="text-muted" href="/project/">项目</a></div><div class="col-md-6"><a class="text-muted" href="/solution/">问答</a></div><div class="col-md-6"><a class="text-muted" href="/wenku/">文库</a></div><div class="col-md-6"><a class="text-muted" href="/code/">代码</a></div><div class="col-md-6"><a class="text-muted" href="/lib/">经验</a></div><div class="col-md-6"><a class="text-muted" href="/news/">资讯</a></div></div> <ul class="list-unstyled text-small ut-mt20"><li><a class="text-muted" title=" 安卓开发专栏" target="_blank" href="http://www.open-open.com/lib/list/177">安卓开发专栏</a></li><li><a class="text-muted" href="http://www.open-open.com/lib/tag/开发者周刊" target="_blank" rel="tag">开发者周刊</a></li><li><a class="text-muted" href="http://www.open-open.com/lib/view/open1475497562965.html" target="_blank" rel="tag">Android Studio 使用推荐</a></li><li><a class="text-muted" href="http://www.open-open.com/lib/view/open1475497355674.html" target="_blank" rel="tag">Android开发推荐</a></li></ul> </div> <div class="col-md-3"> <h5>帮助中心</h5> <ul class="list-unstyled text-small"><li><a class="text-muted" href="/upload.html">文档上传须知</a></li></ul> <h5>关于我们</h5> <ul class="list-unstyled text-small"><li><a class="text-muted" href="/about.html">关于深度开源</a></li><li><a class="text-muted" href="/duty.html">免责声明</a></li><li><a class="text-muted" href="/contact.html">联系我们</a></li></ul> </div> <div class="col-md-6 text-center"><img class=center-block src="https://static.open-open.com/img/logo01.svg" width=190px alt="深度开源"><small class="d-block mb-3 text-muted ut-mt40">© 2006-2019 深度开源 —— 开源项目,开源代码,开源文档,开源新闻,开源社区  杭州精创信息技术有限公司  <br/><br/><img src="https://static.open-open.com/img/beian.png"/><a target="_blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=33018302001163">  浙公网安备 33018302001163 号</a>  <a target="_blank" href="https://beian.miit.gov.cn">浙ICP备09019653号-31</a></small></div> </div> </div> </footer> <div id="fTools"><span id="gotop"> <i class="fa fa-arrow-up" aria-hidden="true"></i> </span><span id="feedback" title="建议反馈"> <i class="fa fa-inbox" aria-hidden="true"></i></span></div> <script type="text/javascript" src="https://static.open-open.com/js/lib.js?v=1.02"></script> <script type="text/javascript" src="https://static.open-open.com/assets/popper.min.js"></script> <script src="https://static.open-open.com/js/bootstrap.min.js"></script> <script type="text/javascript" src="https://static.open-open.com/js/base.js?v=1.02"></script> <script type="text/javascript" src="https://static.open-open.com/js/jq-plug.js?v=1.02"></script> <script> $(function () { JC.reminderPop();//弹出用户信息 // JC.messagesPop(); //JC.getNotice(); //动态广播 $(".link-login").click(function(){ JC.lORr('login'); }); $("#topSearch").searchInit(); //用户登录状态 JC.setLogin(false); }); </script> <!-- JavaScript at the bottom for fast page loading --> <script> //index $(function () { function GetUrlParms() { var args = new Object(); var query = location.search.substring(1);//获取查询串 var pairs = query.split("&");//在逗号处断开 for (var i = 0; i < pairs.length; i++) { var pos = pairs[i].indexOf('=');//查找name=value if (pos == -1) continue;//如果没有找到就跳过 var argname = pairs[i].substring(0, pos);//提取name var value = pairs[i].substring(pos + 1);//提取value args[argname] = decodeURI(value);//存为属性 } return args; } var channel = ["all","learn","enjoy","resource","doc","solution","ppt", "", "", "pdf", "project", "lib", "code", "news", "blog"], args = new Object(), url = "https://www.open-open.com/search/", kw = "", t = 0, page = 1, channelList=$(".all-sort-list"); args = GetUrlParms(); if (args["kw"] != undefined) {kw = args["kw"].replace(/\+/g,' ').replace(/(^\s*)|(\s*$)/g, "");} if (args["page"] != undefined) {page = args["page"];} if (args["t"] != undefined) {t = parseInt(args["t"]);} $('.'+channel[t]).addClass("active"); $("#search-form input[name=t]").val(t); function goto(t) {return (t==0)?url+ "?kw="+kw:url+ "?kw="+kw+"&t="+t;} $('.tab').click(function () { window.location = goto($(this).data('t')) }); $('#search-form .close').click(function () { $("#search-form input[name=kw]").val('').focus(); $(this).hide(); }); }); </script> <!-- end scripts --> </body> </html>