Sometimes, when you work from home... (1)
share
digg
by
HeatherLeigh (0)
on
One Louder (0)
1 week, 3 days
ago
permalink
you get stuck on this decision: is this work-related or personal? My work stuff ends up on my desk and my personal stuff ends up on my desk. No right or wrong. It just is. My work "to do" list sits on top of a flyer for a green cleaning service, which is on top of a list of the top SE Asian tech universities, which I used as a coffee coaster. Sorry Suranaree University, ...
Baidu sotto accusa: SERP viziate a pagamento (1)
share
digg
Evolution of the visual system is key to abstract art (1)
share
digg
firefly sucked (1)
share
digg
3 weeks
ago
permalink
11/10/08: firefly sucked Can't wait for the next comic? Vote to see a preview.
-
Missy said:
fucking lol forever
JS跨域访问操作iframe里的dom (4)
share
digg
by
apple (0)
on
Alipay UED (0)
3 weeks, 2 days
ago
permalink
很多人一直都有个想法,要是可以随心所欲的操作iframe就好了。这样静态页面也就有了相当于后台动态页面php,jsp,asp中include,require实现统一多页面布局的能力。 通过Javascript的帮忙我们可以像后台一样动态加载操作iframe对象属性src指向的html页面的内容。这样的操作需要提供两个页面,一个页面是iframe所在页面(页面名称:iPage.html),另一个页面是iframe属性src指向页面(页面名称:srcPage.html)。 iPage.html,<body>里dom: <iframe id=“iId“ name=“iName“ src=“srcPage.html“ scrolling=“no“ frameborder=“0“></iframe> srcPage.html,<body>里dom: <h1>妹妹的一天</h1> <p>早上吃早点,中午约会吃饭,下午K歌,晚上和哥哥瞎折腾</p> 下面讨论ie下JS是怎么操作以上两个页面,再讨论firefox的做法,最后给出兼容ie,firefox浏览器操作iframe对象的方法。 一、ie下访问操作iframe里内容 大家都知道iframe是非标准html标签,它是由ie浏览器推出的多布局标签, 随后Mozilla也支持了这个标签。(闲话,嘿嘿) 1. ie通过document.frames["IframeName"]获取它,例子:我们在iPage.html里输出srcPage.html里h1的内容,JS如下: alert(document.frames["iName"].document.getElementsByTagName(‘h1‘)[0].firstChild.data); 你会发现这样在页面里加入代码,好像并没有输出想要的东东,为什么呢?这个我也没有搞清楚,只是习惯性的加入了window.onload就有输出了(注:JS代码都写到这个事件里去),知道的人士可否告诉我下。why?更改之后代码ie下有了输出,firefox下document.frames没有定义错误提示: window.onload = (function () { alert(document.frames["iName"].document.getElementsByTagName(‘h1‘)[0].firstChild.data); }); 2. ie另一种方法contentWindow获取它,代码: window.onload = (function () { var iObj = document.getElementById(‘iId‘).contentWindow; alert(iObj.document.getElementsByTagName(‘h1‘)[0].firstChild.data); }); 此方法经过ie6,ie7,firefox2.0,firefox3.0测试都通过,好事啊!嘿嘿。(网上一查,发现Mozilla Firefox iframe.contentWindow.focus缓冲区溢出漏洞,有脚本注入攻击的危险。 后来听说可以在后台防止这样的事情发生,算是松了口气。不过还是希望firefox新版本可以解决这样的危险。) 3.改变srcPage.html里h1标题内容,代码: iObj.document.getElementsByTagName(‘h1‘)[0].innerHTML=‘我想变成她一天的一部分‘; 通过contentWindow后访问里面的节点就和以前一样了。 二、firefox下访问操作iframe里内容 Mozilla支持通过IFrameElmRef.contentDocument访问iframe的document对象的W3C标准,通过标准可以少写一个document,代码: var iObj = document.getElementById(‘iId‘).contentDocument; alert(iObj.getElementsByTagName(‘h1‘)[0].innerHTML=‘我想变成她一天的一部分‘); alert(iObj.getElementsByTagName(‘p‘)[0].firstChild.data); 兼容这两种浏览器的方法,现在也出来了,就是使用contentWindow这个方法。 嘿嘿!操作iframe是不是可以随心所欲了呢?如果还觉得不爽,你甚至可以重写iframe里的内容。 三、重写iframe里的内容 通过designMode(设置文档为可编辑设计模式)和contentEditable(设置内容为可编辑),你可以重写iframe里的内容。代码: var iObj = document.getElementById(‘iId‘).contentWindow; iObj.document.designMode = ‘On‘; iObj.document.contentEditable = true; iObj.document.open(); iObj.document.writeln(‘<html><head>‘); iObj.document.writeln(‘<style>body {background:#000;font-size:9pt;margin: 2px; padding: ...
11 Great User Interface Design Resources - Microkid.net (2)
share
digg
3 weeks, 2 days
ago
permalink
A listing of pattern libraries, image collections and official interface guidelines that contain huge amounts of smart interface design solutions
Professional Blog, Personal Opinion (2)
share
digg
by
Jason Falls (7)
on
Social Media Explorer (7)
3 weeks, 5 days
ago
permalink
Yesterday I offered a little personal tome about voting. I felt awkward posting it since this blog is not about politics, nor my personal opinion. Yes, my feelings on certain issues percolate from time to time here, but you don’t read this blog for Jason’s personal world view. This blog is about social media, public relations, marketing and communications. My opinions on those topics is fair game. But how far outside that realm is acceptable? ...
Wordpress Themes (4)
share
digg
Pure*Gold PC (1)
share
digg
by
Titanas (0)
on
pestaola.gr blog (0)
1 month
ago
permalink
Υπάρχουν πολλά πράγματα που είναι χρυσά πέρα από την σιωπή και αν θέλετε να επενδύσετε σε κάτι ακριβότερο από το Super Talent Gold Pico-C USB Flash Drive έχετε ακόμα μια ευκαιρία. Το Pure*Gold PC δεν έχει τιμή αλλά χρυσογυαλίζει από όποια γωνία και αν το κοιτάξετε. Αν ενδιαφέρουν τα ηλεκτρονικά, αυτά περιλαμβάνουν “Intel Core 2 Duo CPU, 4GB RAM, 1TB σκληρό δίσκο, NVIDIA GeForce 8600GT στα γραφικά, 8 USB και 2 FireWire ports”. Αν ακόμα ...
All Change in the Webstrong House (1)
share
digg
by
Iarfhlaith (0)
on
Iarfhlaith Kelly - Code agus Craic (0)
1 month, 2 weeks
ago
permalink
When a company doubles in size in a single day (from one to two!) some major changes need to be made. The way I run every aspect of my business has been turned on its head. Now you would think that all this change would be tough and stressful, and… you’d be right. But it has also forced me out of my comfort zone and I’ve had to completely redesign how I develop code for ...