将表单序列化成json格式
$.fn.serializeObject = function()
{
var o = {};
var a = this.serializeArray();
$.each(a, function() {
if (o[this....
ajax跨域上传图片
jQuery.extend({
handleError: function( s, xhr, status, e ) {
// If a local callback was specified, fire it
if ( s.error )
s.error( xhr, stat...
layui获取select值
<select class="form-control input-sm" name="category" lay-filter="category" aria-invalid="false">
...
layui时间戳转换工具
/*时间戳转换插件*/
layui.laytpl.toDateString = function(d, format){
if(!d){
return ""
}
var date = new Date(d || new Date())
,ymd = [
this.digit(date.getFullYear(), 4)
,this.d...
前端验证码
<canvas id="canvas" width="120" height="40"></canvas>
<a href="#" id="changeImg">看不清,换一张</a>
<script>
/**生成一个随机数**/
function randomNum(min,max...
layui 关闭父级打开的本窗口
var index = parent.layer.getFrameIndex(window.name);
parent.layer.close(index);
当鼠标抬起进行数据搜索展现
$('.selectBox input').keyup(function() {
var me = $(this), v = me.val().replace(/^\s+|\s+$/g,"");
var lis = $(this).parents(".title").siblings(".content&qu...
遍历显示(可用递归调用)暂无时间修改
var jsonDate=[
{
"id": 1,
"name": "电子",
"editTime": "2010-01-01 12:12:12",
"child": [
{
"id": "11",
...