Web Info & Tutorials

February 15th, 2008

BEVO AGRO INC. ANNOUNCES NEW FINANCING

LANGLEY, BC, Feb. 15 /CNW/ - Bevo Agro Inc. is pleased to announce that its wholly owned subsidiary, Bevo Farms Ltd., has negotiated a new credit facility totalling $24,000,000 with Farm Credit Canada . via Canada NewsWire

February 15th, 2008

LIVING AND TRAINING ABROAD

Our Webmaster has additional a newborn country to the BudoSeek forum: Living and Training Abroad.

Please see liberated to deal your experiences. I undergo there are quite a some members here who hit drilled in Korea. This module be a pleasant possibleness to study experiences with those experience and upbringing in…

February 15th, 2008

FACEBOOK STYLE INPUT BOX

If you used Facebook on a regularly basis, you’ve probably come across their cool autocomplete method of adding multiple recipients to messages. For those that haven’t seen it, here’s a pic:

Guillermo Rauch set out to build something similar and he did a very good job of mimicking this behavior using MooTools v1.2:

While working on my big and exciting new project, I decided to include an input that resembles the famous Apple Mail to: textfield. I’d seen it in Facebook before, which has a really decent implementation of this concept (it work well, but it doesn’t respect any modern programming principles; basically, it’s a big tag soup with lots of inline Javascript)

I created my own, MooTools 1.2 compatible, in just 5kb. It’s not only small, but also really frexible! Here are some notes of the creation process and how to implement it in your own projects.

Well, the folks at InteRiders wanted to get in on this Facebook goodness so they created a Prototype version of this control.

This is the Prototype version of the extended script by Guillermo Rauch. As with the previous script, this script has been converted and operates like the original. An extended and upgraded version will be posted later on this week, if you have any comments or requests, please post them and I will try to include all the requested features in the upcoming Proto release.

This is a very nice variation of the autocomplete metaphor and MooTools and Prototype developers can now leverage this enhanced functionality.

February 15th, 2008

USING SETTIMEOUT TO SOLVE DOMCONTENTLOADED?

Stuart Colville was reading the following info on setTimeout() from JavaScript the Definitive Guide:

“In practice, setTimeout() tells the browser to invoke the function when it has finished running the event handlers for any currently pending events and has finished updated the current state of the document”

He then thought, does setTimeout solve the DOMContentLoaded problem?.

He tested this hypothesis with a simple function that uses DOMContentLoaded for Mozilla and Opera, else uses setTimeout:

JAVASCRIPT:
function DOMReady(f){
  if (/(?!.*?compatible|.*?webkit)^mozilla|opera/i.test(navigator.userAgent)){ // Feeling dirty yet?
    document.addEventListener("DOMContentLoaded", f, false);
  }  else {
    window.setTimeout(f,0);
  }
}
 

Jonathan Snook ran with this and found that it works until gzip gets into the picture:

If you could guarantee that the file would be sent via gzip compression every time then yes, using setTimeout could potentially be a viable way to mimic DOMContentLoaded. In fact, you could forego using DOMContentLoaded at all and simply rely on setTimeout for all browsers. window.setTimeout could be the new window.onload.

In a related note, I recently saw some benchmarks showing that setTimeout(..., 0) may take longer than you think to run.

February 15th, 2008

NEWJS: JAVASCRIPT PROJECT CREATION

When you start a new JavaScript library, how do you layout the source files, the tests, the distribution files? Do you have support scripts to generate distributions from source files? Run your JavaScript unit tests? Generators to create new unit test HTML files?

This is why Dr. Nic created newjs, a Ruby script that sets you up to do the right thing by your pet project. No longer will you crack open a .js file and slice and dice your JavaScript willy nilly. Instead, you will use newjs to:

  • Setup your directory structure for src, tests, documentation, distribution
  • Start building unit tests using unittest.js
  • Generate test files
  • Run unit tests and get nice HTML output
  • Package up your src for distribution
  • Create a website for your project (wait. is this maven???? ;)

February 15th, 2008

DUAL-SIDE TEMPLATING FOR 2010

Michael Mahemoff is bullish on templating that runs all over the shop, and explained the progression in his Dual-Side Templating piece:

  • c. 1995: Server-Side Templating. This is the standard templating used in Java’s JSP, Perl’s Mason, PHP, ASP, etc. ie some html code with <?= “language” ?> code embedded in it.
  • c. 2005: Browser-Side Templating. This is an Ajax pattern where you have a block of HTML that includes some custom syntax (e.g. <% ${foo.bar} %>) which are then processed via Javascript.
  • c. 2010: Dual-Side Templating A single template is used on both browser and server, to render content wherever it’s appropriate - typically the server as the page loads and the browser as the app progresses. For example, blog comments. You output all existing comments from the server, using your server-side template. Then, when the user makes a new comment, you render a preview of it - and the final version - using browser-side templating.