February 23rd, 2007 by Aaron N.
There are several new goodies in the most recent release of the CNET libraries. I’ve got examples and details in the wikitorial, but here’s a quick list:
- JsonP – handles grabbing Json from a foreign domain; works a lot like Ajax
- Element.smoothShow/smoothHide – a height/opacity transition for an element to add it to the page smoothly.
- Element.setPosition – position an element relative to another (the window or another dom element)
- ProductPicker – a generic “picker” to allow users (typically in a CMS) to choose an item from a data source.
- stickyWinHTML – a default html block for in-page popups
- SimpleSlideShow – a very, very simple slideshow for dom elements or images
Have fun.
Posted in CNET JS Standards, Examples, Widgets | Comments Off
February 23rd, 2007 by Aaron N.
Hi gang,
I’ve set up an svn server at Google code to host all our “common” or “public” libraries. This is so you can keep up to date with the files as we fix bugs and whatnot. CNET has it’s own internal source control, but it’s behind our firewall. Rather than go through the trouble of setting up an external server for our libraries, I’m just using Google’s stuff.
In addition to this, I’ve broken up the libraries into chunks so you can download all the little files, or you can download just our extensions in a group. It’s not as fancy as Valerio’s document builder, but it’ll have to do.
Note that our libraries are working off the development version of Mootools, so if you are using 1.0 you may find that some of our functions don’t work. I’ve included in the SVN our copy of Mootools, which will work with all our extensions. This copy is likely a few revisions behind the dev version.
Posted in CNET JS Standards | Comments Off
February 20th, 2007 by Aaron N.
Over at Ajaxian today they have a short post on whatshouldisay.com and their crafty use of effects and whatnot. Check out the visual sorting on this page. I think this type of thing makes a page so much more fun to play with. They seem to be using the Y!UI for this.
Update: I went ahead and did my own version of this slick sorting: Fx.Sort.
Posted in Visual Effects | Comments Off
February 16th, 2007 by Aaron N.
via Ajaxian and pertinent to some of our security efforts:
Shreeraj Shah has published a paper on Crawling Ajax-driven Web 2.0 Applications.
Crawling web applications is one of the key phases of automated web application scanning. The objective of crawling is to collect all possible resources from the server in order to automate vulnerability detection on each of these resources. A resource that is overlooked during this discovery phase can mean a failure to detect some vulnerabilities.
The introduction of Ajax throws up new challenges for the crawling engine. New ways of handling the crawling process are required as a result of these challenges. The objective of this paper is to use a practical approach to address this issue using rbNarcissus, Watir and Ruby .
It really shows how powerful tools like Watir are.
Posted in Tools | Comments Off
February 12th, 2007 by Aaron N.
I ran a pass through our reporting software the other day and here’s the breakdown of browser usage @ CNET. It’s not in a fancy chart because I don’t have time for that kind of thing, but I’m sure you’ll manage:
OS:
92.3 % Windows
6.8% Mac
0.4% Linux
Browser:
Firefox: 23%
MSIE: 71%
Safari: 4%
MSIE:
55.9% ver. 6
43.5% ver.7
Summary:
Firefox has made some strides but continues to be an underdog. Safari is only barely big enough to even worry about supporting it (though of course we do). IE7 has made a lot of headway since it’s launch, but IE6 is still the winner (sigh) with near 40% of the total market. No other browsers cracked the 1% mark.
It’s scary that .6% of our IE users are still using version 5 (dear god why?!?) and .1% of them are using IE 4. These people, presumably, were stranded on an island after their plane crashed. There they found a fall-out shelter with a computer that requires you to click a button every 108 minutes. This button reads “object expected in line 12.”
Posted in CNET JS Standards, Reference | Comments Off
February 9th, 2007 by Aaron N.
If you are new to javascript or Mootools, you should:
2) Read
the Mootools Tutorial
Now, the problem with the Tutorial is that it shows you snippets of how Mootools work, but doesn’t put them all together to show you how to actually do things on a page.
So in an effort to help people see the right way to write code (well, at least how I write code; “right” is definitely subjective with javascript), as well as how to use the accordion and things like Fx.Slide, I’ve authored a simple little page that demonstrates these things and comments them line by line.
So:
3) View the source of the Mootools Beginner’s Example
Posted in Best Practices, Event Scripting, Examples, Manipulating the Dom, MooTools, Reference, Visual Effects | Comments Off
February 8th, 2007 by Aaron N.
Ajaxian has a post on Yahoo!’s latest and greatest: pipes. I haven’t had the time (and am not likely to get the time) . I’m somewhat blown away. It’s stuff like this that makes me wonder what the interweb is gonna be like in a few years. I’m beginning to think that I am going to need a Gibson-esque Johnny Mnemonic port or something.
Crafty. Very crafty.
Yahoo! has a new service called Pipes that aims to make it easy to build mashups:
Pipes is a hosted service that lets you remix feeds and create new data mashups in a visual programming environment. The name of the service pays tribute to Unix pipes, which let programmers do astonishingly clever things by making it easy to chain simple utilities together on the command line.
The UI is a rich Ajax application using YUI of course. It is the kind of UI that feels like Flash, but then you do a view source and you see:
<script type="text/javascript" src="http://us.js2.yimg.com/us.js.yimg.com/lib/common/utils/2/yahoo-dom-event_2.1.2.js"></script>
<script type="text/javascript" src="http://us.js2.yimg.com/us.js.yimg.com/lib/common/utils/2/connection_2.1.2.js"></script>
<script type="text/javascript" src="http://us.js2.yimg.com/us.js.yimg.com/lib/common/utils/2/animation_2.1.2.js"></script>
<script type="text/javascript" src="http://us.js2.yimg.com/us.js.yimg.com/lib/common/utils/2/dragdrop_2.1.2.js"></script>
<script type="text/javascript" src="http://us.js2.yimg.com/us.js.yimg.com/lib/common/widgets/2/logger/logger_2.1.2.js"></script>
<script type="text/javascript" src="/js/maxwell.js"></script>

Posted in 'Industry' News, 3rd Party Libraries | Comments Off
February 6th, 2007 by Aaron N.
Thought I’d drop a note that there are a few bug fixes in the CNET common libraries that are worth downloading if you’re using our stuff.
- Modalizer – The overlay div that it creates has to be larger than the window space (only slightly). In IE, it eats memory when you create a div this large that is semi-transparent. Before I would create a new overlay every time you instantiated Modalizer, but now I reuse the layer. Note that it doesn’t leak this memory. As soon as you reload the page or browse elsewhere you get it back.
- string.cnet.js – re-implemented String.replaceAll() because String.replace(old, new, “ig”) doesn’t work in, you guessed it, IE. In IE, it would seem that you can’t pass in that third option (the regex options). If you want to replace something globally you have to do String.replace(/old/ig, new). String.replaceAll() does this for you (and lets you pass in regex options as a third and optional argument).
- StickyWinModal – this was calling the wrong hide method for the StickyWin instance and the result was that the iframe shim was left behind on the page.
Posted in CNET JS Standards | Comments Off
February 5th, 2007 by Aaron N.
Another Ajaxian post today, this one on DJAX, a language that sits on top of javascript. This reminds me of haxe and to a lesser extent of things like the Google Toolkit. Still, I think this is a good idea, but it definitely represents that “next level” of javascript that may actually make it harder for people to adopt. Another programming language? A lot of javascripters barely can handle javascript.
That said, on a personal level, I find it interesting and I want to dig into these kinds of solutions because they are so promising. Anyone have an opinion here? Read the rest of this entry »
Posted in 3rd Party Libraries | Comments Off
February 5th, 2007 by Aaron N.
Via Ajaxian is this post revising the age-old window.onload problem. I tried to write a dom polling method that would re-evaluate the dom every few milliseconds maybe 3 or 4 months ago but got distracted. Here’s the work of smarter and less easily distracted people than I, and it’s worth reading (even if you skip to the end). Maybe we’ll work this into Mootools.
Peter Michaux has written a detailed post on the window.onload problem:
The goal of unobtrusive JavaScript programming it to separate the JavaScript behavior from from the HTML content and is analogous to the goal of unobtrusive CSS design to separate the CSS presentation from the HTML content. Separation of presentation and content has been possible for years but there is one wrinkle standing in the way of completely separating the behavior. This article is about previously suggested techniques to enable this separation, their problems and a new option that combines the strengths of the current techniques with an extra bonus into a new robust solution.
Read the rest of this entry »
Posted in Event Scripting, Optimization | Comments Off