Anyone who develops Javascript long enough undoubtedly runs into difficulties involving the various security features all browser vendors implement. These security features are a good thing — they protect us from malicious users hijacking our browsing experience. But they can certainly cause some headaches. The security feature that presents the most difficulty for us as developers is the same origin policy.

In a nutshell, this policy prevents pages from two different domains from modifying each others properties, using XMLHttpRequest, setting cookies etc. For instance, Example.com and OtherExample.com can’t get references to each others document properties and can’t set cookies on each other. Additionally, Example.com can’t use XMLHttpRequest (aka AJAX) to load a resource from OtherExample.com. This last bit is probably the biggest issue for developers today — in todays world of open web services and mashups. How do you consume a web service with Javascript if you can’t load the data properly? Read the rest of this entry »

If you talk to me regularly then you already know how much I love stream wrappers in PHP. The other day I was positively giddy with how easy it was to solve a particular problem by using stream wrappers. Read the rest of this entry »

Some of you may know that the last few weeks I’ve been writing an AJAX chat application that plugs in to DeskPRO. One of the problems we ran into is playing sound notifications. The problem is that IE7 likes to pop up a security warning when you use the usual <embed> code. This was unacceptable. So today I just want to briefly talk about how I solved the problem. Read the rest of this entry »

Online apps usually have a way to set your timezone so that all times are local to you. One common feature many end-users expect is some mechanism that automatically detects when DST is on/off and changes things accordingly. Read the rest of this entry »

So many web developers know just a little about Javascript. Enough to use a library like jQuery somewhat effectively, but not enough to understand how to create properly structured applications. I’m not going to get into how objects work in Javascript, or how to use them, I’ll leave that for another day. I just want to touch on the topic of member visibility (that is, private/protected methods and properties). Read the rest of this entry »