• Supporting the ServerJS Standard On Axiom Stack: First Steps

    I've been following the ServerJS list on google groups for a while.  I'm excited about the emergence of javascript as a full-fledged modern language.   But it's sorely lacking in a lot of functionality we've come to take for granted in programming languages.  The ServerJS group has taken on the task of developing standard APIs and libraries to enable things like file system access, networking capabilities (although this is partially addressed by XMLHttpRequest) and a sensible, secure module system for pulling everything together.

    There are several usable implementations of the early ServerJS standard available right now.  So I sat down this weekend to see if I could integrate one of them into Axiom Stack (the open source server-side javascript framework that powers this site.)  I chose Narwhal simply because the primary maintainer, Tom Robinson, is focusing on support for the Rhino JavaScript Engine.  Getting things up and running ended up being pretty straight forward, so I figured I'd outline things here.

    On the surface Narwhal, and any other ServerJS compatible implementation, is just a library of javascript files that provide the standard APIs.  The underlying implementation relies on java packages though, which is why the Rhino engine is key.  Narwhal includes Rhino as a dependency and it also includes scripts for bootstraping the javascript environment in a JVM and loading the necessary js files.

    Keep Reading Supporting the ServerJS Standard On Axiom Stack: First Steps »

  • Firefox Comment Rendering, It's Not A Bug! But We'll Fix It

    Ran into an issue recently with how Firefox renders HTML comments.  Everyone here knows what comments look like right?

    
    <!-- This is a comment. -->
    <!--
            They can also span
            multiple lines.
    -->
    

    Pretty straight forward. And you would think it's easy to identify when rendering. Once you see the "<!--" then ignore everything until you see "-->".  Except Firefox doesn't do that exactly.  It turns out if you have 2 dashes or hyphens contained in the comment, Firefox will prematurely end the comment.  And probably break your page.  Example:

    Keep Reading Firefox Comment Rendering, It's Not A Bug! But We'll Fix It »

  • Does a Complex Web App Really Need Clean Markup?

    I found myself pondering this question today in a response to a status message

    While I do really like the ExtJS APIs the generated markup makes me cry. A button should not be made of multiple 's. #fail

    I had this same gripe a while back when I was hacking facebook with greasemonkey.  I felt like facebook was flouting everything we've learned about web standards and structured content.  Everything is a <div> wrapped in multiple other <div>'s.  In fact, most of the content is generated with Javascript.  With their last major redesign, Facebook eliminated many of the explicit page reloads.  Now they literally pull in the entire page with ajax and regenerate the markup.  And a couple of weeks after I finished my greasemonkey script, they changed the interface again and broke it!

    Keep Reading Does a Complex Web App Really Need Clean Markup? »

  • Add Your Current Facebook Status To Your Home Page

    Update: The most recent changes to Facebook broke this! Hopefully I'll get some time to fix it at some point.
    --

    Ever since the most recent Facebook redesign, you can't see your current status from the home page.  You have to go to your profile or find out through some other method.  This has been irking me, because the only time I update my status is when I got to my home page to read something and realize that it's old.

    Anyway, I was looking for something to do so I wrote a greasemonkey script that adds the status back to the home page.  You'll need the firefox add-on if you don't already have it.

    Keep Reading Add Your Current Facebook Status To Your Home Page »

  • Generating Abstract Text from HTML content

    In the world of online content management, we often want to introduce an article with a summary or abstract. The best example of this is the front page of a blog. You are presented with a list of the most recent articles with just a few paragraphs from each to get your interest. If want to continue you can click through and get the full text. Until recently, this blog didn't do that. It's a pretty important addition for me because my posts tend to run long, and my Home Page was getting pretty lengthy from just 3 posts. Here's the rundown on adding this feature.

    A Few Requirements

    First a little setup. Ideally this summary would be written specifically for the article and formatting nicely for it's space in the page. But since we live in the real world, we are generally given a few requirements for our system to make this easier. These are the general guidelines I used:

    Keep Reading Generating Abstract Text from HTML content »

< | 1 | 2 | 3 | >