JS cookie操作
假设cookie中存储的内容为:name=jack;password=123则在页面中获取变量username的值的JS代码如下:var username=document.cookie.split(";")[0].split("=")[1]; //JS操作cookies方法! //写cookies function setCookie(name,value
假设cookie中存储的内容为:name=jack;password=123则在页面中获取变量username的值的JS代码如下:var username=document.cookie.split(";")[0].split("=")[1]; //JS操作cookies方法! //写cookies function setCookie(name,value
html demo<div id="headerMenu"> <ul> <li> <a href="/"> 首页</a> </li> <li> <a href=&qu
思路:将图片base64值转换生成图片文件并保存,将图片保存路径转换成二维码。二维码的生成使用了phpqrcode类增加了一个删除的操作,传入开始和结束日期,删除该范围内生成的图片及二维码<?php //包含一个文件上传类中的上传类 header('Content-Type: text/html; charset=utf-8'); $content = file_g
接收前端发送的文本,使用php内置函数实现文本转换图片<?php header('Content-Type: text/html; charset=utf-8'); $content = file_get_contents("php://input"); $content = json_decode($content,true); $ty
谷歌浏览器默认禁用了flash插件,所以要判断下浏览器是否禁用了flashfunction flashJudge(){ var flag = false; if(window.ActiveXObject){ try{ var swf = new ActiveXObject("ShockwaveFlash.ShockwaveFla
丢弃小数部分,保留整数部分parseInt(5/2)向上取整,有小数就整数部分加1Math.ceil(5/2)四舍五入Math.round(5/2)向下取整Math.floor(5/2)
html demo<input id="checkboxID" type="checkbox" value="imxgr" />javascript写法if(document.getElementById("checkboxID").checked){ alert("checkbox is
javascript写法获取值var obj = document.getElementById("testSelect"); //定位id var index = obj.selectedIndex; // 选中索引 var text = obj.options[index].text; // 选中文本 var value = obj.options[index].value