二期项目中生成的简历二维码是使用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')); <form action="save.php" method="post" target="nm_iframe"> &nbs...
<!DOCTYPE html> <html> <head> <title>捕捉和冒泡</title> <meta charset="utf-8"> </head> <bo...
<!DOCTYPE html> <html> <head> <title></title> <meta charset="utf-8"> </head> <body>...
开发需求如下,商品下单后需要指定送到日期:送达日期为周一 周三 周六 ,如果今天周一,用户选择周一即为下一周周一。代码如下:<html> <head> <meta charset="utf-8"> <title>...
//构造函数 function Box(name,age){ this.name=name; this.age=age; this.run=function(){ return this.name+'--'+this.age; } } var&nbs...
//我们创建每个函数默认都有一个prototype(原型)属性,这个属性是一个对象 //1.我是普通的构造方法,我的属性叫实例属性,我的方法叫实例方法 /* function Box(name,age){ this.name=name; this.age=age; this.run...