javascript解码\x\u格式的16进制编码。script function hexToString(str) { var mc = str.match(/\\x[a-z\d]{2}|\\u[a-z\d]{4}/gi); var val = ''; for (var i = 0, j = mc.length; i j; i++) { val += String.fromCharCode(parseInt(mc[i].substring(2), 16)); } return val; ..
2015-8-18更新:其实是firefox自己搞的,要去掉启用adobe flash保护模式复选框,重启firefox后才行。建议firefox还是不要用uploadify,不是每个用户都会设置firefox 的shockwave flash插件这个配置。点击选项取消勾选启用adobe flash保护模式。 使用uploadify选择文件上传时,报错:Some files were not added to the queue: The file xxx is..
昨天upload在firefox下出现uploadify:Some files were not added to the queue: The file xxx is empty.错误,于是升级了flash插件解决了这个bug。但是今天重启后发现firefox下uploadify尽然不会生成flash dom对象了,显示的是原始的html dom对象,但是chrome下是好的。chrome下uploadify生成了flash对象firefox下uploadify显示的是DOM对象..
JavaScript数字滚动效果 div id=n style=height:20px div class=num1/div div class=num2/div div class=num3/div div class=num4/div div class=num5/div div class=num6/div div class=num7/div div class=num8/div div class=num9/div div class=num10/div ..
一个css3动画效果,点击链接标签弹出详细内容层,从页脚升起然后平铺整个屏幕,而原来的内容层缩小。具体看效果了,装逼可以一用。嘿嘿。注意使用标准浏览器如chrome,firefox,ie8-就不要来凑热闹了。!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtdstylehtml, bod..
javascript utf-8,unicode(utf-16)编码相互转换源代码 //javascript将UTF-16字符串转转换为UTF-8字符串 function utf16ToUtf8(s){ if(!s){ return; } var i, code, ret = [], len = s.length; for(i = 0; i len; i++){ code = s.charCodeAt(i); ..
javascript加载xml文件源代码 /* 通过ajax加载xml文件,返回xml dom对象 备注:chrome浏览器下请求本地xml文件会报XMLHttpRequest cannot load file:///xxxxx.xx. Cross origin requests are only supported for HTTP,需要搭建服务器 */ function LoadXML(url) { var xhr = window.ActiveXObject ? new ActiveXObject..
提交表单时chrome控制台出现错误:An invalid form control with name is not focusable. 出现这个错误是因为表单中包含了HTML5属性required的控件不可见(如这个控件style display设置为none或者其父容器display为none),被隐藏起来了,导致chrome无法聚焦这个值为空的输入项弹出错误提示窗口而报错:An invalid form control with nam..
javascript将字符串转为base64编码和解码base64字符串类库代码。script var Base64 = { // private property _keyStr: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=, // public method for encoding encode: function (input) { var output = ; ..