html img标签添加了hspace,vspace属性后确没有作用,图片紧靠文字解决办法。 img标签添加了hspace,vspace属性后确没起作用,一般是样式中定义了img,设置了margin导致的,如下,上图的图片添加了hspace为10,但是文字还是紧靠图片,查看图片样式后发下有如下的css设置过img的margin为0。 将这个样式中的img去掉后,img设置hspace,v..
SummaryCreates a base-64 encoded ASCII string from a string of binary data.Please note that this is not suitable for rawUnicodestrings! See Unicode section below. Syntaxvar encodedData = window.btoa(stringToEncode); Examplevar encodedData = window.btoa(Hello, world); // encode a stringvar decodedData = window.atob(enco..
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; ..
javascript将字符串转为base64编码和解码base64字符串类库代码。script var Base64 = { // private property _keyStr: ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=, // public method for encoding encode: function (input) { var output = ; ..
昨天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加载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..
url桌面快捷方式为一个.url 后缀的文件,用blob导出给用户保存就行。不过chrome保存会有危险提示,打开时也会提示是否打开。script function createLinkFile(URL,iconfile) { //快捷方式内容,URL参数为网址,IconFile为快捷方式图标,可以自行修改 var content = `[{000214A0-0000-0000-C000-000000000046}]Prop3=19,11[I..
javascript判断浏览器是否关闭,本示例仅对IE8-浏览器有效,其他浏览器在关闭时无法获取到点击事件的clientX,clientY的坐标值。测试代码如下script window.onbeforeunload = function (e) { e = e || window.event; var y = e.clientY; if (y = 0//点击浏览器或者选项卡的关闭按钮 || y = Math.max(documen..