
JAVASCRIPT
码0扣1
学海无涯,回头是岸!
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
网页嵌入视频播放
//打开视频function openVideo(url){ var videohtml= ''; videohtml += "<div><video width='800' height='500' controls>"; videohtml += "<source src='"+url+"' type='video/mp4;codecs=\"avc1.4...原创 2020-01-08 17:53:37 · 547 阅读 · 0 评论 -
js截取字符串,并加省略号
//text:字符串,numSub:截取的字符长度function showText(text, numSub){ if(text == null){ return ""; } if(text.length > numSub){ return text.substring(0, numSub - 1) + "..."; } return text;}...原创 2018-03-25 15:48:26 · 2171 阅读 · 1 评论 -
Jquery的ajax标准格式!
$.ajax({ type : "POST",//请求方式 url : url", //请求地址 async:false, //ajax方法外部属性获取值需要加上这行 data : {//传参 "NAME": "ABC","ID":"123" }, dataType : "text"原创 2018-03-26 17:35:13 · 456 阅读 · 0 评论 -
Iframe获取子页面元素
// 获得父级var tIframe = window.parent.document.getElementById('mn-iframe').contentWindow;// 将获得的值放入父级中tIframe.$("input[name='checkSpecialId']").val(id);原创 2018-04-16 10:32:51 · 1563 阅读 · 0 评论 -
webupload上传多图片插件
官网:http://fex.baidu.com/webuploader/引入文件:webuploader.js、Uploader.swfvar uploader; uploader = WebUploader.create({ // 选完文件后,是否自动上传。 auto: true, // IE使用swf上传 swf:$("#Path").val()+'/js/...原创 2018-05-03 11:55:49 · 379 阅读 · 0 评论 -
layui提交多个相同name的值
//详情初始化function initForm(flag){ layui.use(["element", "form"], function() { element = layui.element; form = layui.form; form.render('select'); //刷新select选择框渲染 form.on('submit(reportlab...原创 2018-06-22 16:58:34 · 11055 阅读 · 0 评论 -
应用系统退出后按后退按钮可访问先前的页面
$(function(){ //禁用后退按钮 if(window.history && window.history.pushState){ $(window).on('popstate',function(){ window.history.pushState('forward', null, '#'); window.history.forward(...原创 2018-09-28 14:49:02 · 501 阅读 · 0 评论 -
JavaScript每两列换行tr
var dialoghtml = "";for(var j = 0; j < list.length; j++){<td></td> if(j%2==0 || j==list.length){ dialoghtml+="</tr>"; if(j%2==0&&j<list.length+1){原创 2018-11-26 15:20:12 · 998 阅读 · 0 评论