01 2012 档案
摘要:浏览器检测FILEREADERif(typeof FILEREADER == undefined) alert('浏览器不支持FILEREADER)方法名 参数 功能abort null 中断读取readAsBinaryString file 读取文件为二禁制码readAsDataURL file 读取文件为urlreadAsText file,[encoding] 读取文件为文本readAs...
阅读全文
摘要:检测浏览器是否支持canvasvar canvas = document.getElementById('tutorial');if (canvas.getContext){ var ctx = canvas.getContext('2d'); // drawing code here} else { // canvas-unsupported code here}三个函数用于绘制矩形的:fillRect(x,y,width,height): Draws a filled rectangle 矩形strokeRect(x,y,width,height): Dra
阅读全文
摘要:function getSelectText() { return document.selection && document.selection.createRange().text || window.getSelection && window.getSelection() || document.getSelection && document.getSelection() || '';}function getSelectText(){ var txt = null; if (window.getSelection){
阅读全文