
javascript
iteye_19163
这个作者很懒,什么都没留下…
展开
-
联合数组以及Prototype的风险
今天在用for in循环遍历一个联合数组的时候,不仅遍历到了联合数组中的内容,而且还得到了prototype扩展Array对象的一些方法名。到底应该如何解决呢? 转自:http://holdbelief.iteye.com/blog/296648...原创 2009-03-03 16:42:11 · 79 阅读 · 0 评论 -
用js正则表达式验证手机号,座机号和email格式
/** *author zhutou **///手机号:13912345678function isMobil(s) { var patrn = /^[0-9]{11}$/; if(!patrn.exec(s)) { return false; } return true;}//普通座机号:+0086-010-66668888function isTel(s)...原创 2009-03-31 10:32:06 · 1121 阅读 · 0 评论 -
setStyle() throwing errors in IE when object does not exist
Kickboy wrote:> I'm trying to set the style of elements that are created through> document.createElement() using the setStyle() function. Looks> something like this:> > var newdiv = doc...原创 2009-12-21 01:22:43 · 130 阅读 · 0 评论 -
access denied using ie when upload file
That's right, avoid form.submit() if you can. (And 99% of the time, you can.) IE (especially IE7) takes a lot of extra security precautions when a script in one frame tries to invoke certain actions (...原创 2009-12-31 18:17:12 · 126 阅读 · 0 评论 -
cookie in iframe
1.页面里的COOKIE不能是浏览器进程的COOKIE(包括验证票和不设置超时时间的COOKIE),否则跨域会取不到.这点做跨域COOKIE的人比较少提到.不过实际上留意下几家大学做的方案,有细微的提到他们的验证模块里的COOKIE是有设置超时时间的.2.当利用IFRAME时,记得要在相应的动态页的页头添加一下P3P的信息,否则IE会自觉的把IFRAME框里的COOKIE给阻止掉,产生问题.本...原创 2008-11-20 13:43:43 · 142 阅读 · 0 评论 -
ie6下实现png透明
update:最近发现一个更好的解决方案,使用VML替换AlphaImageLoader,可以解决被替换元素hover状态不起作用的问题。详见:http://www.dillerdesign.com/experiment/DD_belatedPNG/。我使用VML方式做的页面:http://fang.kuwo.cn/p/Radio // Universal transparent-PNG ...原创 2009-10-10 14:27:12 · 125 阅读 · 0 评论 -
javascript图片浏览器的核心——图片预加载
让图片轮换的时候不出现等待,最好是先让图片下载到本地,让浏览器缓存起来。这时,一般都会用到js里边的Image对象。一般的手段无非这样:function preLoadImg(url) { var img = new Image(); img.src = url;} 通过调用preLoadImg函数,传入图片的url,就能使图片预先下载下来了。实际上,这里用到的预下载功...原创 2009-10-15 12:11:27 · 148 阅读 · 0 评论