Recent Blog Posts
Blogs » Archive for July, 2007
Win Cash for the best Facebook App!
Via digg: Our current feature article about developing for the Facebook Platform with PHP is extraordinarily timely, given the recent announcement from venture capital firm Bay Partners on Tuesday that they will be offering cash prizes for the best Facebook applications.
Dubbed the “AppFactory,” the program will grant awards of US$25,000 to $250,000 to Facebook developers using a fast-track approval process. The company hopes to make up to 50 such awards, Salil Deshpande, a partner at Bay Partners, told the E-Commerce Times.
Given that Facebook has just clocked 30 million members, there’s never been a better time to make your app even more social. Email your application for the AppFactory program to Bay Partners to be eligible.
Insert in place without document.write
So here’s the situation: you want to syndicate some content using JavaScript to pull in the data (like AdWords or similar programs). The syndication script can’t know anything about the page it’s being used on — so it can’t have a dependency on the existence of particular elements. Yet the host page needs to be able to control where the content is inserted — the syndication script needs to insert the content wherever the <script> tag is.
How do you do it?
Well you probably do what Google does and use document.write. But document.write is not a nice technique, it has some notable issues:
- document.write does not work in XHTML mode (on XHTML pages served as XML)
- content written in with document.write may not subsequently appear in the page’s DOM, which means no further access to manipulate it programmatically, and no access to accessibility APIs
- document.write is conceptually wrong because it treats nodes as serialized text — which they’re not — they’re nodes
But what’s the alternative? DOM creation techniques need an existing element reference to work with; even innerHTML needs to know where to write the HTML. And in both cases, simply appending to <body> is not an option if you want the new content …
JavaScript: How Simple is Too Simple?
The following is republished from the Tech Times #167.

When we first sat down to write Simply JavaScript, Cameron and I had to decide how complicated we wanted to make things. On the one hand, this was to be a beginner’s book, so we wanted to keep things simple (it is called “Simply JavaScript”, after all).
On the other hand, JavaScript isn’t all that simple in the real world, and we felt too many other books were guilty of not giving their readers the tools they needed to understand and write real-world code. We didn’t want to make the same mistake of “dumbing down” the language to produce an easy-to-read book.
To show you what I mean, let’s throw together the same JavaScript example using code at several levels of complexity. The example will be a simple one: we’ll prompt the user to ask whether links to external sites should be opened in a new window. As we’ll see, however, even a simple example like this can get very complicated if you let it!
Simple but Ugly
If code simplicity were the ultimate goal, this example could be very simple indeed:
<a href=”http://example.com/” onclick=”
if (confirm(’Open this …
Is Selling Text Links Dangerous?
There’s no doubt that selling text links is big business, but is is a risky business? The question, is selling text links dangerous, pops up in web master forums with increasing frequency. For me, two questions really come to mind:
1. Will selling text links hurt my site?
I don’t think there is anything wrong with selling (or buying) text links. But my opinion doesn’t matter. The fact is, buying and selling text links could potentially hurt your site. From Google’s webmaster guidelines:
“Don’t participate in link schemes designed to increase your site’s ranking or PageRank”.
Pretty obvious how that fits. Further, Matt Cutts from Google says:
But for everyone else, let me talk about why we consider it outside our guidelines to get PageRank via buying links. Google (and pretty much every other major search engine) uses hyperlinks to help determine reputation. Links are usually editorial votes given by choice, and link-based analysis has greatly improved the quality of web search. Selling links muddies the quality of link-based reputation and makes it harder for many search engines (not just Google) to return relevant results.
But can’t search engines detect paid links?
Yes, Google has a variety of algorithmic methods of detecting such links, and …
iPhoney: Test Your Site for iPhone Compatibility
Can’t afford an iPhone (or don’t live in the US) but eager to check how your site might look on the hottest device of the moment?
Enter the iPhoney: a small (1.3MB) desktop application that simulates web browsing on the newly released device.
iPhoney is not an iPhone simulator but instead is designed for web developers who want to create 320 by 480 (or 480 by 320) websites for use with iPhone. It gives you a canvas on which to test the visual quality of your designs.
This cleverly named app is a great tool for developers who want a rough idea of whether their site will be usable by the one million iPhone owners who signed up in the first six days. With sales like that, it’s conceivable that, within a few years, visitors browsing on an iPhone could amount to a significant percentage of your site’s visitors.
Sure, developers have always been able to resize their window to test how a site renders on smaller screens, but the beauty of this app is:
- You can instruct it to send the iPhone User Agent string, in case the site you’re checking …
CSS: Using Percentages in Background-Image
Last week you might have noticed we’re trialling a new experimental screen gadget in our books section — a JavaScript-powered book that allows you to thumb through the book to get a quick sense of the layout and feel.
While I might talk about that directly later, I thought I’d share some of my research on CSS background images along the way.
Like a lot of CSS/JS based animation these days, I used ‘background image sprites’ — a large background-image containing all the frames, with background-position used to control which frame (or animation cell) is being displayed. Each click moves the background position exactly one frame down. The key advantage to using one image is you can guarantee all frames will be cached the moment your animation is ready.
There are three viable methods available to control background-position, and you are not allowed mix and match them (i.e. background-position: top 50%;).
1) Keywords : i.e. background-position: top right
Keywords are probably the most commonly used method, because they are really easy to get your head around and they work totally reliably on all browsers. You don’t even had to worry about their ordering — ‘top right’ works just as well as ‘right top’.
The main …
Behind the Scenes at SitePoint: Code Week
You might not realize it, but quietly hidden in our secret sitepoint.com lair, a team of developers are furiously building the next generation of Marketplace and Contests. Our mission is fairly simple: take the current system and build it into a solidly architected platform which we can grow rapidly into something truly beautiful. Initially we planned to also build a SitePoint branded interplanetary rocket, but we grudgingly conceded that it was out of scope.
As an experiment in rapid timeline reduction (the teeth gnashing and pulling of hair from the forums hasn’t gone unnoticed), we decided to ship the team off to a beach house in Rye for 10 days of unchecked productivity. Theoretically. Here in lies the tale of the result.

The team of five is made up of myself (Lachlan Donald), Paul Annesley, Andrew Krespanis, Lucas Chan and James Edwards (our accessible front-end rockstar). All up, its a pretty awesome line-up, and I have high hopes for what we can do, especially if we ever get to build that interplanetary rocket.
Our goals for redeveloping Marketplace and Contests were to get the codebase into a state from …
@media London Podcasts
So you couldn’t make it to @media London this year and you’re feeling a bit like you missed out? Fear not, as podcasts of the sessions are available! The first round of podcasts (from the first day’s sessions, with presentations from web luminaries such as Molly Holzschlag, Jesse James Garrett, and Tantek Çelik) are now online. Podcasts of the second day’s sessions will be uploaded by mid-July.
News Wire: The iPhone Cometh
-
iPhone JavaScript Experiments: Day One
JavaScript guru Joe Hewitt is not impressed with the iPhone as a rich application development platform. Lack of mousedown and mousemove events, for example, prevent developers from taking advantage of the iPhone’s multi touch display.
(tags: javascript mobile) -
Firebug for iPhone
Firebug creator Joe Hewitt sensed the need for a Firebug-caliber diagnostic tool for the iPhone. He has built an experimental Python-based server that you can run on your desktop computer to provide a remote JavaScript console for an app on the iPhone.
(tags: javascript mobile python software) -
Building a desktop application with Ext, AIR, Aptana and Red Bull
A proof of concept ends up producing quite a polished result: a desktop-like to-do list application that will run either in the browser (with Google Gears offline storage) or on the desktop (with Adobe’s AIR).
(tags: javascript air google) -
Flip
A cute online tool that will rotate plain Unicode text 180° (upside down). The result is not exactly accessible, but it is impressive.
(tags: design) -
jQuery 1.1.3: 800%+ Faster, still 20KB
jQuery keeps getting better with a massive speed boost. A smattering of new features, a revamped animation system, and a rewritten events subsystem round out this update. Also in this announcement: jQuery UI, a new drag & …
Another year, another CFUnited
Did you make it to CFUnited this year? Yea me neither, I was supposed to go but after my little sabbatical to Shreveport LA plans kind of got lost.
BUT lucky for us we can still experience it even if we didn’t get to sit in the chairs and pal around the conference area. Be sure to check out the feeds to get the scoop.
One post I want to point out in particular is the one Ben Forta made about performance for CF8. Let’s just say the numbers are amazing!
Also if you’re someone who likes to get a quick overview, then Matt Woodward has some great Google Doc outlines of the events he attended.
If you attended or know of some other posts of interest feel free to share them in the comments.
Sponsored Links
SitePoint Marketplace
Buy and sell Websites, templates, domain names, hosting, graphics and more.
SitePoint Kits
Download sample chapters of any of our popular kits.
The Search Engine Marketing Kit, 2.0
The Web Design Business Kit 2.0
The Email Marketing Kit
The Usability Kit
SitePoint Books
Download sample chapters of any of our popular books.
