随笔分类 - javaScript
摘要:<script src="lazysizes.min.js" async=""></script> 使用示例 <!-- non-responsive: --> <img data-src="image.jpg" class="lazyload" /> <!-- responsive example
阅读全文
摘要:<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog" role="document"> <div class
阅读全文
摘要:$("#form_user_input").bootstrapValidator({ message : 'This value is not valid', excluded : [':disabled'],//[':disabled', ':hidden', ':not(:visible)']
阅读全文
摘要:$.cookies.set(key, obj, { hoursToLive: 2}); key标识的键 , obj存入的值可以缓存json对象, hoursToLive 缓存小时数 $.cookies.get(key); 根据key获取缓存的值 使用cookie,每次请求都携带cookie cook
阅读全文
摘要:<script type="text/javascript" src="jquery-1.11.3.min.js"></script> <script type="text/javascript" src="jquery.lazyload.min.js"></script> <script type
阅读全文
摘要:<form action="" method="post" enctype="multipart/form-data" id="表单ID"> <input type="text" name="name"> <input type="file" name="file"> </form> 需要使用下面的
阅读全文
摘要:$.pjax({container:'#content_center',url:href,data:data}); $(document).on('pjax:send', function() {//pjax链接点击后显示加载动画; //显示动画 }); $(document).on('pjax:c
阅读全文
摘要:需要使用异步加载async : true 否则不会出现等待效果 $.ajax({ url : $('#form').attr("action"), data: $('#form').serialize(), cache : false,//true使用缓存 。 false不使用缓存 async :
阅读全文
摘要:<script> function WidthCheck(str, maxLen){ var w = 0; var tempCount = 0; //length 获取字数数,不区分汉子和英文 for (var i=0; i<str.value.length; i++) { //charCodeAt
阅读全文
摘要:例如控件ID为user.id 使用$("#user.id")不能得到正确的结果 必须使用\\转义 即$("#user\\.id")
阅读全文