Non-static method Cgn_Session::getSessionObj() should not be called statically, assuming $this from incompatible context


Non-static method Cgn_SystemRequest::getCurrentRequest() should not be called statically, assuming $this from incompatible context


Non-static method Cgn_SystemRequest::getUser() should not be called statically, assuming $this from incompatible context


Non-static method Cgn_ErrorStack::count() should not be called statically, assuming $this from incompatible context

News roundup: jspp, node-scraper, Nike Better World


jspp: JavaScript Pre-Processor is a new node.js package heavily inspired by PHP (Hypertext Preprocessor), as the name suggests. This seems like something perfect for frontends most familiar with PHP who are just learning node.js (like me).

jspp runs initialization JavaScript in a PHP-like block: <?jspp.init /* code */ ?>. After the block is closed, we can output regular HTML just as in PHP. It might be a little confusing, but any further server-side JavaScript is processed in plain old script tags with a special MIME type: <script type="application/jspp">/* code */</script>. This will make more sense after you see the examples on the website (click the link above!).

If you have npm (more than likely if you’re running node.js), just type this to install: npm install jspp


node-scraper is a fairly simple screen scraper that relies on node.js and jQuery. Though I’ve been admittedly slow to jump on the node.js bandwagon, I’ve always thought node.js would be the perfect platform for a screen scraper or web crawler. Instead of finding content with regexes (eek) you can find content just as you would on the client side with your favorite selector engine, in this case jQuery (or Sizzle to be more precise).

node-scraper is pretty basic: it allows you to specify one or many pages to be scraped and allows you to specify a callback for each. There’s also a setting to allow you to throttle back connection attempts so you don’t pound any particular server.

I realize this wasn’t made to really be a web crawler, but it would be handy if a future iteration of node-scraper supported link following. I’ll put that on my wish list!

Nike Better World

And now we’ll take a brief departure for a not-so-JavaScript news update.

I’m not particularly a fan of Nike, but their new site Nike Better World is worth a look. It’s made in the spirit of Ben the Bodyguard and other one-page scrolling webpages. It achieves a neat effect, with some layering of graphics to achieve a parallax scrolling effect. Other than just scrolling, the page can be navigated by buttons on the right side of the page pointing to each section. What’s also somewhat fun is a counter at the bottom of the page which keeps track of how many pixels you’ve scrolled.

When you pry into the source code you’ll find plenty of new semantic HTML5 tags (yay) but soon will find that they’re actually being used incorrectly (boo). Each section of the page is within a Section element, which makes sense, but some sections only contain one child (Article), which itself contains one child (Header), which contains all of the content for each section.

There’s still a bit of confusion over how to use these new elements correctly. We used to have div-itus (overuse of divs in webpages), now it seems we’ll be seeing a lot more of HTML5-itus. Don’t be afraid to use divs where it makes sense to!

Upcoming Events

jQuery: Making Javascript fun again (HTML5 Silicon Valley) (January 18, 2011 in Mountain View, CA)
Paul Irish on HTML5 Boilerplate (January 27, 2011 in San Francisco, CA)
Day of JavaScript on Mobile (January 27, 2011 in Mountain View, CA)
Mozilla/P2PU School of Webcraft (January 2011 online)
JS Boot Camp (February 10-11, 2011 in Reston, Virginia, US)
Confoo.CA: Web Techno Conference (March 9-11, 2011 in Montreal, Canada)
JSConf 2011 (May 2-3, 2011 in Portland, Oregon, US)
NodeConf 2011 (May 5, 2011 in Portland, Oregon, US)
jsday (May 12-14, 2011 in Italy)
Mobilism (May 12-13, 2011 in Amsterdam)


The “catch” with try…catch by Ben Alman examines a quirk of using the variable “e” in IE6-8 (the lesson: use another variable name)
Exploring JavaScript for-in loops (JavaScript, JavaScript) – an extensive look at using the for-in loop properly (including using some new features in ECMAScript 5), and of course an examination of some IE quirks
OOP The Good Parts: Message Passing, Duck Typing, Object Composition, and not Inheritance by Nick Fitzgerald
Spotlight – Recommend Tools And Resources For JavaScript Developers: Issue 1 – Addy Osmani gives a weekly round up of the latest in JavaScript. This week’s focus is node.js.
5 Things You Might Not Know about jQuery written by David Flanagan as a tie-in to his latest book
How to develop a HTML5 Image Uploader by Paul Rouget explores uploading and manipulating images through JavaScript
Backbone and couchdb by Ben Nolan
Audio: Brian LeRoux on HP Palm WebOS 2.0 (Minute With Mobile)
WebKit implements Mozilla’s animationTime property
Require.js: Integration with Has.js (require.js documentation) – uses the power of Has.js and Closure Compiler to remove dead/unsupported code
jsshell: Shell/bash in Node.js
List of languages that compile to JS
2010 Through the Lens of YUI Theater – Eric Miraglia of YUI has posted links to tons of videos recorded last year. Lots of JavaScript, Node.js, and other frontend topics. Awesome resources!

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • description
  • Reddit
  • TwitThis
  • Simpy
  • StumbleUpon

One Comment

  1. Grumpy says:

    Posted on January 7, 2011. My RSS reader bumpbed this today and says: “Published: Today, 17:43″.

Leave a Reply

© webdevpublishing 2011