![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
js
疯癫的代码搬运工
海内存知己,天涯若比邻。
展开
-
看看用js编写一个时间的倒计时器
<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>时间倒计时</title> <script src="times.js"></script> &原创 2020-07-13 17:54:49 · 470 阅读 · 1 评论 -
Math.ceil(),Math.ceil(),Math.floor()的区别
1.Math.ceil() “向上取整”, 即小数部分直接舍去,并向正数部分进1 double a = 3.1415926; double a2 = 18.58; double a3 = -15.23; double a4 = -16.85; double a5 = -17.5; double a6 = 17.5; double ceil1 = Math.ceil(a); // 结原创 2020-07-02 14:41:20 · 557 阅读 · 0 评论 -
java 后台接口生成二维码图片
1.controller层写code方法/** * 生成图片二维码 * @param request * @param response * @param content 为前端传过来的二维码的内容 * @throws Exception */ @GetMapping("/code") public void code(HttpServletRequest request, HttpServletResponse respon原创 2020-06-19 18:36:48 · 989 阅读 · 1 评论 -
js 时间戳转换成日期
//转换时间function timestampToTime(timestamp) { var date = new Date(timestamp * 1000); //时间戳为10位需*1000,时间戳为13位的话不需乘1000 var Y = date.getFullYear() + '-'; var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '原创 2020-06-17 17:44:46 · 251 阅读 · 0 评论 -
Ajax实现跨域上传文件
<!DOCTYPE html><html><head> <meta charset="UTF-8"> <title>aaaa</title> <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script></head><body> <input type=原创 2020-06-06 16:04:34 · 1366 阅读 · 1 评论 -
JS字符串常用方法总结
JS字符串常用方法总结1、toLowerCase(): 把字符串转为小写,返回新的字符串。var str="Hello World";var str1=str.toLowerCase();console.log(str); //Hello Worldconsole.log(str1); //hello world2、toUpperCase(): 把字符串转为大写,返回新的字符串。var str="hello world";var str1=str.toUpperCase();consol原创 2020-06-02 16:00:26 · 4368 阅读 · 0 评论 -
js实现cookie的存取值
1.js存入cookiefunction setCookie (name, value){ //name相当于key,value为转入的值 var expdate = new Date(); //初始化时间 expdate.setTime(expdate.getTime() + 30 * 60 * 1000); //时间单位毫秒 document.cookie = name+"="+value+";expires="+expdate.toGMTString()+"原创 2020-05-28 10:50:58 · 2869 阅读 · 0 评论