RSS ? Recent Blog Posts

Blogs » Archive for August, 2008

Debugging JavaScript: Throw Away Your Alerts!

by James Edwards

Are you overly reliant upon the alert() statement when debugging JavaScript? James suggests considering the throw() statement, which provides several advantages, including writing debug information to the console and termination execution. Give it a go!

 

Yahoo! Runs Headlong Into Newspaper Business

by Josh Catone

While everyone else is running away from the newspaper business, Yahoo! is running straight at it. According to an interesting profile from the AFP, Yahoo! is planning to lean on its huge global audience of over 500 million people to build out its own original news reporting arm.

 

The Week In ColdFusion: 13-19 Aug: And amongst the Gurus, an ArgumentCollection did break out

by Kay Smoljak

So… did ya miss me? I had an awesome holiday, and have come back to an overflowing feed reader. Although I may touch on some of the big things that happened while I was away, I’m going to concentrate on the current week – otherwise this post would take you an hour to read and me all day to write!

Community

It was quite a while ago now that Adobe announced that ColdFusion would become free for educational institutions. Brad Wood has posted a call to the community to help make that push successful by helping to develop curriculum for teaching ColdFusion. There’s some things already happening by the sound of it, so If you have an interest in the academic sphere check Brian’s post out.

Conferences

Although conference season seems to be slowing down, one of the biggest conferences – Adobe MAX US, to be held this year in San Francisco – is till on the horizon. Ben Forta warns that early bird pricing ends on August 31st.

Just because the big conferences are over doesn’t mean that conference-style learning can’t continue. I’m a big fan of BarCamp – user-generated “unconferences” – which are held in hundreds of locations around the …

 

Money of the Crowds: Crowdsourced Funding

by Josh Catone

The wisdom of the crowds has been put to use to do some awesome things already, such as create a huge encyclopedia (Wikipedia), and manage a mutual fund (Marketocracy). But what about the money of the crowd? It’s being put to use as well.

 

SitePoint Services: Introducing Clients To Vendors

by Matthew Magain

Interested in trialling a new lead-generation service? SitePoint Services is a vendor-matching service that connects individual companies looking for web development services with qualified vendors who offer those services. As a customer, you can request multiple quotes for your project, at no obligation. And as a vendor, it’s a terrific way to expand your client base.

 

Free Book Giveaway: Adobe AIR For JavaScript Developers

by Matthew Magain

It’s official—SitePoint readers love quizzes, and they love book giveaways even more.

First, we gave you multiple chances to receive a free copy of Jack Herrington’s pocket guide to Flex 3 (the dead-tree version). All you had to do was read an article or two about developing with Adobe Flex and take a short quiz.

Now we’re doing the same thing with Adobe AIR. We’ve just published the first of two articles on building applications with AIR, Learn Adobe AIR, Part 1: Build A Note Storage App, by Akash Mehta. Clocking in at over 4,000 words, Akash gives you a comprehensive tour of the AIR platform, taking you through how to interact with a database, manage events, create XML-driven dropdown menus and more.

Once you’ve read Akash’s tutorial, test yourself by taking the quiz. The first 100 people to complete the quiz will receive a free copy of the pocket guide, Adobe AIR For JavaScript Developers (once again, that’s the dead-tree version) delivered to your door.

And like before, we’re also making the book available as a free PDF download, so if you miss out on the print version, be sure to grab …

 

Using JSON for Language-independent Configuration Files

by James Edwards

The growing availability of JSON parsing in server-side frameworks elevates the usefulness of JavaScript beyond client-side programming, to providing base syntax for a generalized data interchange format. Well duh.

But a not-immediately-obvious advantage of this is the ability to have language-independent configuration files for Ajax development.

In a nutshell — a JavaScript object-literal can be parsed as JSON with (say) PHP to create a corresponding associative array.

Consider a simple config object like this:

const config = {
‘lang’ : ‘en’,
‘host’ : ’sitepoint.com’
};

We can include that in a regular <script> and get access to its properties with JavaScript:

alert(config['lang']); //outputs “en”

All good. But we can also import it into PHP and parse it like this:

$datastring = file_get_contents(’config.js’);

$regexes = array(
array(”p”=>”/[\w]*(\/\/).*$/m”, “r”=>”"), //remove comments
array(”p”=>”/’/m”, “r”=>”\”") //replace single-quotes with double-quotes
);

foreach($regexes as $regex)
{
$datastring = preg_replace($regex['p'], $regex['r'], $datastring);
}

preg_match(”/config[ ]?=[ ]?\{([^\;]+)\\;/”, $datastring, $matches);

$config = json_decode(’{’ . $matches[1], true);

And then we have that same data in a PHP associative array:

echo $config['lang']; //outputs “en”

Availability of JSON parsing in PHP

The native functions json_encode and json_decode were not added to PHP until Version 5.2. If you’re …

 

eBay Is Slowly Losing Its Soul

by Josh Catone

eBay has long had a reputation of being a place you could find anything under the sun. But as the site transitions to a fixed price focus and slowly kills off the auction format that made it a huge web success, the variety that made eBay famous may also go by the wayside.

 

Report: News More Likely to Go Viral than Humor

by Josh Catone

A new report indicates that news is more likely to go viral than humorous content because prolific media sharers prefer to share news content. But we think that the conclusion by the report’s author may be a little off: the mainstream still likes funny stuff.

 

No Twitter SMS? Now You Can Pay For It

by Josh Catone

Last week, citing ballooning costs, Twitter turned off outgoing SMS updates to a number of countries outside of Canada, India, or the US. A couple of third party sites are now letting users in those countries pay for their own SMS updates via Twitter.

 

Sponsored Links

SitePoint Marketplace

Buy and sell Websites, templates, domain names, hosting, graphics and more.

Follow SitePoint on...