Rss Directory > Computer > Software > scriptNode
Tips and tricks for web developers.
 
  Sun, 26 Oct 2008 22:23:52 +0100
After much debate, the minds behind PHP have made an important decision. The good news is, PHP will support namespaces. The (arguably) bad news is, the namespace separator will be the backslash character. Here’s a simple example of what this will look like: $object_instance = new My\PEAR\Module(’myvar’); PHP 5 already already has its criticisms. The developers looked at [...]
  Wed, 22 Oct 2008 02:17:48 +0200
The ability to write multiline strings is a common feature in many languages. It promotes readability and is often much cleaner than the alternatives. Here’s a typically ugly example of string concatenation in PHP: $my_string = “This string\n”; $my_string .= “spans multiple\n”; $my_string .= “lines.\n”; Thankfully, PHP has the benefit of heredoc syntax, which makes code like this much [...]
  Sun, 19 Oct 2008 11:22:23 +0200
I often chat with a lot of new JavaScript developers. Many of their questions are really easy and can be answered with single-line responses, such as, “How do you append to an array?” myArray.push(thevalue); Easy stuff. What’s unfortunate, though, is when the questions are a bit more involved, and these developers have already searched around a bit [...]
  Tue, 07 Oct 2008 22:25:39 +0200
Web developers don’t usually browse the net like your average surfers. We will often view pages with a critical eye, tear them apart and see how they tick. I know I do. Sure, I’ve got periods when I’m lazy and just feel like surfing around or watching videos. But usually the engineer in me will [...]
  Sun, 28 Sep 2008 10:04:29 +0200
I hear a lot of developers asking about loading CSS and JS files dynamically. Surprisingly, creating script and link nodes is just like creating any other nodes. All you have to do is create them using DOM methods and append to the head: The Script var loadCSS = function(file) { var link = document.createElement(’link’); link.href = file; link.rel = ’stylesheet’; link.type = ‘text/css’; document.getElementsByTagName(’head’)[0].appendChild(link); }; var loadJS [...]
  Sun, 21 Sep 2008 10:00:30 +0200
First, a disclaimer: dynamically evaluating scripts is not recommended! Indeed, if your application requires the usage of this script, chances are you’re doing it wrong. The separation of design and logic likely hasn’t been properly enforced if you’re using this method. It’s just an awkward use-case that should be avoided. That said, here it is… Many [...]
  Fri, 19 Sep 2008 01:50:21 +0200
I’ve been tagged by the insanely creative Jacob Seidelin, which means it’s my turn to fill out the Software Development Meme! How old were you when you first started programming? I was about 12 years old. That combined with my love of Nintendo really makes it sound like I never left the house, but I found time [...]
  Wed, 10 Sep 2008 03:11:51 +0200
I unfortunately am not allowed to participate, but in anticipation of Yahoo!’s Hack Day 2008, I put together a little app I’ll hopefully be able to port to YAP: twittertyper! The concept is very simple. twittertyper displays the latest tweet from Twitter. To read the next one, first type out the tweet. The text is highlighted [...]
  Sat, 06 Sep 2008 06:06:23 +0200
A Scholastic quality assurance employee Quality Assurance people are important and valuable, to be sure, but they can also make developers’ lives much more difficult. This is particularly bad because (like many roles in an organization), their end goal is to help the developers make better software, not stress them out. Here are some of the common [...]
  Wed, 03 Sep 2008 09:39:18 +0200
So unless you’ve been living under a rock, you’ve probably heard about the release of Google Chrome. Being a hardcore Firefox nut myself, I’m not just skeptical, I’m largely indifferent. With Firebug, I’ve got the perfect web developer environment, so I’m good to go. It would be hard to sell me on something else. Google is [...]