This post was published back in 2007. It may not function as originally intended or may be missing images.
5 Things I Learned this Week.
I believe that learning, especially when it comes to being a web developer, should never end. Every week I learn something new that I didn't before. A great thing about the tech community, whenever you run into a problem, you can almost always find someone who is willing to share a solution. I want to give back by sharing the things I learn each week, and linking back to the source. I encourage you to share in the comments what you learned this week as well.
1. Ternary Operator in PHP (and javascript)
Where I learned about it: http://blog.rightbrainnetworks.com/2006/09/18/10-things-you-probably-didnt-know-about-php/
2. When dynamically generating iFrames in IE6 and SSL, their location must be preloaded.
I had a script that was creating empty iFrames serving as an Ajax method. But in IE6, I kept receiving a 'mixed secure and insecure content' warning. Combing through my source code I couldn't find what element wasn't being loaded without https. Well I finally Google'd the problem and found the answer. When I was creating the iFrames, I created them first and then set the src value. I discovered however you need to set the iFrame's src value upon creation with a secure page. If you need a tempory location to point to before loading without an extra page request, you can enter 'javascript:false'.Where I learned about it: http://crazybob.org/2005/06/ajax-ie-iframe-bug.html
3. RegExp Subpatterns
In javascript, when you call the match method, the RegExp object will hold onto the subpatterns so you can reference them after a match.var str = 'http://www.website.com/webpage.html'; if (str.match( '([a-z]+\.com)' )) { alert( RegExp.$1 ); } Alerts: 'website.com';
I learned about this from analyzing the iepnghack.htc code written by Aaron Porter.
4. IE6 Flicker, and Solution
Apparently, previously unknown to me, IE6 checks for a newer version of the background-image CSS property on links every time you move the mouse over a link. You can disable this behavior by running an Internet Explorer command:try { document.execCommand("BackgroundImageCache", false, true); } catch(err) {}I learned about this from: http://www.mister-pixel.com/#Content__state=