
frequency decoder | Unobtrusive Table Sort Script (revisited) A rewrite of the original table sort script that includes a few more features and a much faster sort routine architecture My first free Sunday morning in what seems like an epoch produces a complete rewrite of the original (and by far most popular) lab experiment, the “Unobtrusive Table Sort Script”, that addresses speed issues present within version #1. Plays nicely with the JavaScript global namespace (the script creates and reuses only one JavaScript object) Multiple columns can be sorted at once by pressing Shift while selecting the columns using either the keyboard or mouse The new script sorts (on average – based on my very non-scientific calculations), 5 times faster than its predecessor The plug-in architecture makes writing custom sort functions a breeze The script can highlight both alternate rows and full columns on a table by table basis. Like its predecessor, the script is fully keyboard accessible The script is smart enough not to sort columns containing identical data
Ajax For Evil: Spyjax With great power comes great responsibility. With every advancement in technology we face the threat of it being used for evil purposes. This is the case with AJAX. AJAX has a ton of great uses but one form of negative AJAX has taken life: Spyjax. Spyjax, as I know it, is taking information from the user's computer for your own use -- specifically their browsing habits. The CSS The most important part is making sure the :visited link color is different than the standard link color. The JavaScript The JavaScript is really done into parts. Spyjax isn't as evil as stealing credit card information or social security numbers but it can be an invasion of privacy. What are your thoughts on this practice?
Top 10 custom JavaScript functions of all time Wednesday Nov 30 2005 UPDATE: For anyone who lands on this article months after the fact, there is now a podcast entry about this article reviewing each and every function. If there was ever a universal common.js shared among the entire develosphere, you'd fine these ten (plus one bonus) functions. It would be the swiss army knife no developer would go into production without. 10) addEvent() Surely a staple to event attachment! Scott Andrew's original addEvent() function function addEvent(elm, evType, fn, useCapture) { if (elm.addEventListener) { elm.addEventListener(evType, fn, useCapture); return true; } else if (elm.attachEvent) { var r = elm.attachEvent('on' + evType, fn); return r; } else { elm['on' + evType] = fn; } } 9) addLoadEvent() Originally written by Simon Willison and highly adopted by many others as a simple way to add events to trigger after the page has loaded. addLoadEvent() by Simon Willison assigning multiple load events to window 8) getElementsByClass() 7) cssQuery()
Making Ajax Work with Screen Readers Summary The accessibility community is understandably concerned about the accessibility of client-side scripting, in particular using Asynchronous JavaScript and XML (Ajax) to produce Rich Internet Applications. Steve Faulkner of Vision Australia and founder member of the Web Accessibility Tools Consortium (WAT-C) and myself on behalf of The Paciello Group (TPG) have collaborated in an effort to come up with techniques to make Ajax and other client-side scripting techniques accessible to assistive technology. The Web Accessibility Initiative's Protocols and Formats working group directly address the issue of making rich Internet applications accessible, and we borrow some of their concepts to investigate methods of ensuring that Ajax applications work with leading assistive technology products. Author: Gez Lemon and Steve Faulkner Contents Screen Reader Modes JAWS Virtual PC Cursor Mode The virtual buffer is referred to as Virtual PC Cursor mode in JAWS. JAWS PC Cursor Mode JAWS Forms Mode
Table Sorting, Filtering, Etc from JavascriptToolbox.com Client-Side Table Sorting Basic Example Click on column headers to sort by the column. Sorting is done within the two tbody sections, not across them, and the header and footer are not changed. Client-Side Sorting With Large Table See the Client-Side Sorting With 500 Rows example to see how fast it sorts on your computer. Rowspan/Colspan Correction When cells span rows or columns, their cellIndex property is misleading. Client-Side Table Filtering Client-side table filtering works by scanning each row in the table and matching it against the criteria passed into the filter. Table Striping If a table has alternate rows highlighted and it is sorted, filtered, or otherwise manipulated, the sorted row colors can be mixed up. Client-Side Table Paging Although paging through results or records is usually done by making a trip back to the server, it can sometimes be helpful to page through results on the client side. Alternate Styles Examples Browse icon files for download...
Nikola Derezic - HTTPRequest using IFRAME A few weeks ago I started developing a website, which implemented AJAX. Instead of XML which is usualy used to encode data, I chose JSON. The reason was simple - parsing is much simpler and faster! The page is going to display a large amount of tabular data, which is to be pumped from the server through a HTTPRequest. When receveing HTML data, browser renders it as it arrives. The problem with JSON or XML lies in the fact that the data must be received in whole, before JavaScript can parse it - display results. Multipart Searching the web I discovered that form data can be transfered in multiple chunks - multipart. To my regret, multipart is not supported by IE 6.0 - a browser used by 75-80% of the website visitors! IFrame Despite HTTPRequest has been arround for quite a while, many JavaScript programmer have been using a hidden IFrame to make server requests. As mentioned earlier, my problem was that IE's HTTPRequest didn't support multipart transfers. Best of both worlds The interface
Ten Javascript Tools Everyone Should Have Filed: Sun, Mar 04 2007 under Programming|| Tags: toolbox javascript popular list Javascript frameworks have exploded on the scene over the last few years but they're no replacement for a good toolbox: those little snippets of code you seem to include in every single project. Here's my list of 10 essential Javascript tools everyone should have at their fingertips! #0 - Trim. Trim is one of the things that leave you scratching your head wondering why it was never included in the language to begin with. Thanks to prototyping however it's fairly easy to make up for the original oversight. String.prototype.trim = function() { return this.replace(/^\s+|\s+$/g,""); } String.prototype.ltrim = function() { return this.replace(/^\s+/g,""); } String.prototype.rtrim = function() { return this.replace(/\s+$/g,""); } Usage… var test = " Test "; var test1 = test.ltrim(); // returns "Test " var test2 = test.rtrim(); // returns " Test" var test3 = test.trim(); // returns "Test" #1 - Numeric Sort.
SortedTable Need to sort? SortedTable allows you to make any valid table a sortable one. Tables can be sorted automatically or manually by moving rows. Instructions To start using SortedTable all you need is: have a valid XHTML document, have a valid table* in this document download the following javascripts to a folder on your server: Event.js and SortedTable.js add a class="sorted" to the table include the javascripts in the html (<script type="text/javascript" src="Event.js"></script> and <script type="text/javascript" src="SortedTable.js"></script>) add the following code to the html <script type="text/javascript">onload = function() {var myTable = new SortedTable();}</script> if you're using XML Data Islands add class regroup (you should have class="sorted regroup") This is not the only thing you can do to use this code. Since SortedTable does all it's operations on live DOM lists you can do anything with the tables and it should not break (as many other widgets do). Examples Documentation Author
AJAX RSS Display Using JavaScript only without any server-side script, you want to be able to display a RSS feed? Easy! (But it took me 3 hours of hacking.) First setup a web page like this (write your own HTML, this is only an example): <html> <head> <title>JavaScript RSS Reader</title> <script language="JavaScript" xsrc="rss.js" mce_src="rss.js" ></script> </head> <body> <h1>JavaScript RSS Reader</h1> <div id="rss"></div> <script language="JavaScript"> displayRSS(" </script> </body> You can download the rss.js script. Voilà! Why is this useful? The downside? Any limitations? Here’s an excellent reference on AJAX: using the XMLHttpRequest object.
Workaround Double Callback of FileSystemWatcher Event Handler - The Code Project - .NET Download source files - 912 B Introduction If you've tried to use the FileSystemWatcher to wake up and process a newly created file in some directory, you have likely experienced what I did after coding the simple example found in this Microsoft Tutorial. For my particular application, this wouldn't be fatal since I will need to scan the entire directory at "process" time and once the files are processed they are deleted. Nonetheless, in my testing, I was confounded as to why the double callbacks occurred. The workaround is premised on my best guess that the Framework is notified by the OS when the file handle is created/opened and then again when it is closed (file writing is completed). The highlights from my C# proof-of-concept project are below with the entire project in the zip download. History 20th June, 2006: Initial post
Lutz Roeder's Programming.NET C# VB CLR Makes all .NET code readable .NET Reflector is an extremely fast debugging and decompilation tool that lets you look inside code, even when you don't have the source. Track your data flow through third party libraries and frameworks like ASP.NET, Silverlight, and Enterprise library. .NET Reflector lets you debug third party code in visual studio as if it's your own. Discover whether bugs are in your code or in third party components, and make development on platforms like SharePoint and Umbraco easier. Generate PDBs, attach breakpoints, and debug live to see how your application behaves in real time. Build checking and code recovery Make sure you're shipping the right code, and that your code is protected. Missing or corrupted check-ins can leave you with an executable but no source code.
ASP.Net 2.0 - Master Pages: Tips, Tricks, and Traps Master pages are a great addition to the ASP.NET feature set. Master pages help us build consistent and maintainable user interfaces. Master pages, however, are not without their quirks. Sometimes master page behavior is surprising, and indeed the very name master page can be a bit misleading. In this article, we are going to examine some of the common problems developers run into when using master pages, and demonstrate some practical advice for making effective use of master pages. To make use of master pages, we first need to understand how master pages work. When a web request arrives for an ASP.NET web form using a master page, the content page (.aspx) and master page (.master) merge their content together to produce a single page. The master page contains some common elements, like a head tag. The web form contains a single Content control, which in turn is the proud parent of a Label. protectedvoid Page_Load(object sender, EventArgs e){ MasterPageFile = "~/foo";} using System;