随笔分类 -  Javascript

摘要:<a href="javascript:history.go(-1)">返回上一页</a> <a href="javascript:location.reload()">刷新当前页面</a> <a href="javascript:" onclick="history.go(-2); ">返回前两页 阅读全文
posted @ 2024-08-11 16:51 哆啦阿梦 编辑
摘要:插件链接地址:translate: 两行js实现html全自动翻译,页面无需改动,无语言配置文件,无API Key,对SEO友好! 支持语种:/language.json 存在问题:页面中类似弹窗那种,初始化时未显示的那部分,无法直接翻译,只能翻译可视区域内,无法翻译部分还需借助vue-i18n处理 阅读全文
posted @ 2024-06-28 08:43 哆啦阿梦 编辑
摘要:1 history.replaceState({},'','/home/index/zhuye/info/'+uid); 阅读全文
posted @ 2024-01-04 11:00 哆啦阿梦 编辑
摘要:$.get( "url", { data: value }, function (data, status, jqxhr) { alert('保存成功'); }).fail(function () { //当$.get执行过程失败后,调用的方法,相当于ajax的error方法 alert('保存失败 阅读全文
posted @ 2023-12-08 08:45 哆啦阿梦 编辑
摘要:当点击按钮的时候,判断元素是否disabled,根据判断结果执行后面的代码 $('.export_stu').click(function (e) { if($(this).attr('disabled')!='disabled'){ $(this).attr('disabled',true); } 阅读全文
posted @ 2023-11-16 15:07 哆啦阿梦 编辑
摘要:引入CSS,JS文件 bootstrap.min.css bootstrap-select.min.css jquery-3.7.0.min.js bootstrap.bundle.min.js bootstrap-select.min.js <!-- CSS --> <link href="htt 阅读全文
posted @ 2023-08-11 22:47 哆啦阿梦 编辑
摘要:#控件: ##创建方法: 一、标签模式 <a href='#' class='easyui-linkbutton' data-options="iconCls:'icon-search'">easyui入门</a> 二、编程模式 <a href="#" class="hehe">第一个easyui< 阅读全文
posted @ 2023-02-18 21:58 哆啦阿梦 编辑
摘要:直接上代码: 前端: <script src="./jquery-1.11.2.min.js"></script> <script> $(function () { $('#btn').click(function () { var url = "http://www.test.com/index. 阅读全文
posted @ 2023-01-11 15:51 哆啦阿梦 编辑
摘要:one.js导出 1 // 导出方式一: 2 export let url="http://www.baidu.com/"; 3 export let name="张三"; 4 // export let myfun=()=>{ 5 // return "hello world"; 6 // } 7 阅读全文
posted @ 2022-12-23 21:59 哆啦阿梦 编辑
摘要:前端: 后端: 方法二: 备注: 如果后台接收不到数据,前端又返回parsererror,则是返回数据类型不对 $('.suoluetu').change(function () { //上传图片 if ($(this).val()) { $(this).next().html($(this).va 阅读全文
posted @ 2022-12-13 21:51 哆啦阿梦 编辑
摘要:当使用jquery的append方法添加元素后,发现链接点击失效。 $('#profile13 form a').click(function() { var dv=$(this).parent().parent().clone(); $('#profile13 form').append(dv); 阅读全文
posted @ 2022-10-08 20:44 哆啦阿梦 编辑
摘要:在jquery1.7之后,建议使用on来绑定事件。 $('.upload a').on('click',function(){ $(this).remove(); }) 在DOM渲染的时候,也就是html页面本来在.upload元素下面有a的情况下,a的点击事件是有效的,即a的确能被移除。 但是用j 阅读全文
posted @ 2020-06-06 14:24 哆啦阿梦 编辑
摘要:js中!的用法是比较灵活的,它除了做逻辑运算常常会用!做类型判断,可以用!与上对象来求得一个布尔值, 1、!可将变量转换成boolean类型,null、undefined和空字符串取反都为false,其余都为true。 1 2 3 4 5 !null=true !undefined=true !'' 阅读全文
posted @ 2020-05-14 15:22 哆啦阿梦 编辑
摘要:代码: 1 function arrayToJson(arr){ 2 var js={}; 3 for(var i=0;i<arr.length;i++){ 4 js[arr[i].name]=arr[i].value; 5 } 6 return js; 7 } 阅读全文
posted @ 2019-12-07 19:08 哆啦阿梦 编辑

点击右上角即可分享
微信分享提示