判断页面是否引入jq,如果没有则引入
window.jQuery || document .write("" + ""); setTimeout(() => { if (typeof jQuery !== 'undefined') { (function($) { //在这里写你的jq代码 })(jQuery); } else { console.log('页面jQuery未引用,无法进行相关操
window.jQuery || document .write("" + ""); setTimeout(() => { if (typeof jQuery !== 'undefined') { (function($) { //在这里写你的jq代码 })(jQuery); } else { console.log('页面jQuery未引用,无法进行相关操
.js文件中是无法使用PHP变量的,可以通过引用js时带一个参数过来实现 例如 如何实现: var urlparse; urlparse = document.scripts[document.scripts.length - 1].src.split("\?"); var values = {}; if(urlparse.length > 1){ var
把代码复制近编辑器,class会被过滤,可以按照下面步骤设置 找到ueditor的相关目录 修改config参数 修改处理方法
判断表单中checkbox选中的个数,可用于,限制只能选中几个标签 代码如下 {$vv['name']} $('.lx_num').on('click',function(){ var len = $('.lx_num:checked').length if(len>3){ layer.msg('最多选三个') } console.log(len) })
如图 代码如下 $(document).ready(function(){ $(".zf_hover").hover(function(){ var pic = $(this).attr('item') $(this).css("background-size","cover"); $(this).css("color","#fff"); $(this).c
$有问题时,采用以下方式 (function ($) { $('.portfolio-two-item').click(function () { var video_path = $(this).data('src'); layer.open({ type: 2, title: '查看视频', shadeClose: true, shade: 0.8, /
$(function () { setInterval(function () { var url = "native2.php?action=queryorder&outTradeNo=5df73da68fba5"; $.getJSON(url, function (result) { if (result.code == 0) { window.loca
$('input:radio[name="ext1"]').click(function(){ var checkValue = $('input:radio[name="ext1"]:checked').val(); var url = "{$now_url}?tap=ext1&tap_data="+checkValue location.href = u
每页显示10条 每页显示30条 每页显示50条 layui.use(['form'], function(){ var form = layui.form ,layer = layui.layer; form.on('select(quiz1)', function(data){ console.log(data.elem); //得到select原始DOM
wx.config({ appId: '{$signPackage["appId"]}', timestamp: '{$signPackage["timestamp"]}', nonceStr: '{$signPackage["nonceStr"]}', signature: '{$signPackage["signature"]}', jsApiList: