二期项目中生成的简历二维码是使用canvs生成的,微信浏览器中不能识别二维码,只能扫码。懒的换phpqrcode,于是转canvs。
//设置一个url
var url = "{yun:}$config.sy_weburl{/yun}/mingli/index.php?c=member&a=resume_preview&uid={yun:}$resumeInfo.uid{/yun}&type=scan";
//利用jquery.qrcode.js生成url对应的canvs对象
var qrcode=jQuery('#code').qrcode({
width: 160,
height:160,
text : url
});
//获取页面中的canvs对象
var canvas=qrcode.find('canvas').get(0);
//转canvs对象为base64
console.log(canvas.toDataURL('image/jpg')); 由于工作需要长期使用Ajax,一个页面重复的AJAX请求太多,于是封装起来,只需要编写回调函数/* ------------- 使用方法: 1.ajaxrequest()函数执行准备的参数(1.请求地址2.发送数据字符串拼接3.type值可选get/post4.回调函数名称) exam...
捕捉模式从DOM最顶层一直到最后一层,冒泡正好相反,具体运行以下实例测试.<!DOCTYPE html> <html> <head> <title>捕捉和冒泡</title> <meta charset="...
<form action="save.php" method="post" target="nm_iframe"> &nbs...
<!doctype html> <html> <head> <meta charset="utf-8"> <title>无标题文档</title> </head> ...
代码1:<!--代码开始--> <script src="http://lib.sinaapp.com/js/jquery/1.9.1/jquery-1.9.1.min.js"></script> <script>...
//原型的缺点 function Box(){} Box.prototype={ 'name':'gao', age:23, family:['哥哥','姐姐','妹妹'], &...