February 21st, 2006 by Aaron N.
Another snippet via Ajaxian:
A Javascript tip from Chris Heilmann, who reckons the object literal is “pretty close to sliced bread”. Replace:
var commonSense=null;
var standardsCompliance=“50%”;
function init(){
// code
}
function doStuff(){
// code
}
function doMoreStuff(){
// code
}
with the object literal form:
awesome={
commonSense:null,
standardsCompliance:“50%”,
init:function(){
// code
},
doStuff:function(){
// code
},
doMoreStuff:function(){
// code
}
}
Read the rest of this entry »
Posted in Code Snippets, Examples, Organizing Code | No Comments »
February 16th, 2006 by jlau
In the past two weeks, I have run into live site issues due to namespace problems (javascript functions being named the same) in our javascript files.
I came across this article about versioning. It mentions some solutions for this problem.
Read the rest of this entry »
Posted in Organizing Code | 1 Comment »
February 14th, 2006 by Aaron N.
Over at webreference.com they have an article about loading javascript dynamically as you need it. Basically, you would have a server side applet that was the gateway to all your scripts. This you could query and it would return the javascript that you required to run your app.
I’ve been thinking along these same lines since I read about jspkg, which looks like it does exactly this. Developers could write large javascript libraries without worrying about browser load for specific apps. We could organize this code into convenient libraries that can be shared among us, and then when we develop an app, we just include the functions we require. Thoughts?
Posted in Organizing Code | No Comments »
February 9th, 2006 by Aaron N.
Eric’s comments regarding the use of 3rd party libraries and my response got me thinking that I should post a few examples of what we’ve been doing at Download.com. My only caveat is that I’m probably the person most responsible for this policy as I push for functionality that necessitates their use. Read the rest of this entry »
Posted in Examples, Organizing Code, Visual Effects, moo.fx | No Comments »
February 8th, 2006 by Aaron N.
This looks very promising:
jspkg is a package loader for Javascript, based on pluggable loaders for locating and loading scripts into a client-side Javascript application. It is designed to work best with unobtrusive Javascript libraries, but doesn’t impose any methodology or design on its users.
Examples:
http://jspkg.sourceforge.net/examples/onlyrequired/test.html
more: http://jspkg.sourceforge.net/
Posted in 3rd Party Libraries, Organizing Code, Server-side Integration | No Comments »