Learning JavaScript? Here’s My JavaScript and Related Resources
JavaScript is by far the web's most popular programming language. Being able to operate within nearly every web browser and on every operating system, JavaScript can be found in every nook and cranny throughout the Internet and our systems which we use to communicate through it. With that being said, it's quite unfortunate that it is also considered by many as the web's most misunderstood programming language. With so many resources available (for free even) on the Internet, it's hard to believe that it's widely misunderstood. This is my attempt to rectify this problem...or to at least help educate those who don't understand or those who don't know where to begin.
Where to Begin:
I have to admit that I learned the bulk of my understandings of JavaScript from teaching myself by researching online articles, video lectures, and resources...not from formal education. I'm not saying that you can't successfully learn JavaScript from formal education; I've learned quite a bit from formal education...just not much about programming in general. My advice for newbies to programming in general is to learn how to program before you dive into learning a programming language.
Learning programming is as easy (or hard, depending on how you look at it) as learning calculus. Do realize that when programming you are technically using calculus. Programming = Calculus. You don't necessarily need to know calculus before you learn how to program. (You will slowly realize that as you learn how to program you are literally learning calculus at the same time.) Although, I definitely recommend that you have a good grasp of mathematics and algebra before you begin learning how to program. But, I must point-out, if you already know calculus...you already know how to program!
Where to Begin, with JavaScript:
A great place to begin is by learning about its history. Douglas Crockford, a Yahoo! engineer, is, in my opinion, the definitive "go-to" individual for everything JavaScript. He's graciously spent many years developing an extremely deep understanding of the language, and has posted many online lectures and resources pertaining to it. (Please see the video lectures and resources listed below, specifically the video lecture "Douglas Crockford: The JavaScript Programming Language" and "Crockford on JavaScript - Volume 1: The Early Years".)
As I find more related, quality information I'll update this post, so please bookmark!
Video Lectures:
Douglas Crockford: The JavaScript Programming Language (1hr 50min)
JavaScript: The Good Parts, by Douglas Crockford (1hr 3min)
JavaScript Programming Style and Your Brain (36mins)
Douglas Crockford: An Inconvenient API - The Theory of the DOM (1hr 18mins)
Douglas Crockford: Advanced JavaScript (1hr 7mins)
Crockford on JavaScript - Volume 1: The Early Years (1hr 42mins)
Douglas Crockford: Quality (48mins)
Secrets of JavaScript Closures (5mins)
Web Sites & Resources
ECMAScript.org
ECMAScript Language Specification
JavaScript at Wikipedia
Crockford.com
JS at W3Schools.com
JavaScriptSource.com
JS at Quirksmode.org
Online Tools & Help:
JSLint
JavaScript Cheat Sheets
FireBug
Venkman
Drosera
Dragonfly
JSUnit
JSLitmus
JSMin
BOOKS:
JavaScript: The Good Parts, by Douglas Crockford (Purchase at Amazon)
JavaScript: The Definitive Guide, by David Flanagan (Purchase at Amazon)
Libraries:
Ext JS
jQuery
jQuery UI
Yahoo! User Interface
Dojo Toolkit
Personal Updates
Hi everyone! It's been a while since I've had some free time to myself so I figured I'd let the world know what I've been up to, since I'm such a recluse nowadays. I've been busy creating a new career in Canoga Park (Los Angeles area), California. I'm currently IT Manager/Senior Programmer for a successful startup development company here, and I'm doing just fine.
Our most recent software release is the new employment assistance web service ConnectAJob.com It's in extreme beta version right now of course.
Other than work, I've been working (hah more work) on my own projects. Some new, some old. Some being released soon. Personally, finally been single for a long while and looking I guess? Heh. Stay tuned.
CSS Working Group Published First Working Draft of Grid Layout!
Oh boy is my co-worker (he's a designer) going to be super-excited. Published just yesterday, the CSS Working Group has finished the first working draft of Grid Layout, yep, designers start rejoicing!
For those that don't "get-it"...a grid layout is when you create a canvas and place horizontal and vertical lines evenly, creating a "grid-like" layout. Then, it makes the designers life so much easier to line-up elements and such to produce superb document/interface layouts. This, up until now, has been accomplished using a hodge-podge of techniques, from controlling an HTML table with JavaScript to careful measurements of floated elements...needless to say some pretty complicated things needed to go on in order to simply create a grid layout, let alone use one.
Well, since I'm running out of time I have to cut this short. Check out the CSS Working Group's Official CSS3 Grid Layout Working Draft for in-depth information about this beauty!
Starting A Startup
So here we are. We have an idea. We want to see this idea come to life and be able to live and breathe with the rest of the monster ideas out there. But, how do we go about that?
#1 Make sure the "idea" you have in mind is unique.
I don't know how many times I've heard someone else's idea and thought to myself, "Hmmm, I've already seen a website with that feature or concept." Research your niche, make sure it's unique enough to make a difference, then invest your time, efforts, and money if need be.
#2 Implement the Idea into a public interface.
This, is possibly the toughest part of the bunch. Is your idea "enterprise worthy" or are you just testing the waters? What will your system require? Dynamic scripting language? Database? There's a lot of questions which need to be answered here.
#3 Follow Through.
Make sure your idea is coming across to the masses as you like it to, otherwise this is the time to modify your idea to make it. This part can take some extreme aesthetic decisions to the software process area of your business model for your "idea."
#4 Rinse and Repeat.
Repeat the steps above over, and over again. All the while paying attention to what works and what doesn't. And then implement sparingly to those respected areas to enhance their respective productivities.
In the very near future I'll be discussing in detail the above steps with a real-world example.
STAY TUNED!!!
Finished Basic Facebook Integration with YQ!
As many as you know I've been really busy lately with life and work and haven't had much time at all to work on Killer Media's projects, but that doesn't mean I haven't been making advancements!
Recently I dove into integrating Facebook login with YellowQuery.com, and I have to admit, it wasn't so hard at all!
Of course these screen shots you see here are very, very basic. I'm just posting this to let you know that I'm getting close to opening YQ up for beta.
I'm now working on extreme integration features, like changing Facebook accounts which are attached to the YQ account, having multiple Facebook accounts attached to the YQ account, check-ins integration, etc etc. And, speaking of which. Yellow Query's general business plan has been adjusted recently with the discovery of a HUGE flaw in one of its soon-to-be main competitors...more information about this will be posted after we finalize release arrangements for YQ. STAY TUNED!
Old Technical Posts Archived, New Educational Hub Almost Ready for Beta
So, I'm getting ready to release a new webmaster/web development/affiliate marketing educational hub website and have decided that I'll be posting a lot of educational information and tutorials about related topics there and need to make some room. In doing so I'll be discontinuing the updates of a few of my current websites (like KilerMedia.com which wasn't updated frequently at all anyways) and I'm archiving the relevant posts and info here. So, here they are:
- PHP Tip: Using the Ternary Operator - The ternary operator is your friend!
- Using MySQL's rand() Statement - Easily pull a random item from a table!
- Introduction To PHP: Part #1: What Is PHP? - Need an introduction to the PHP scripting language?
- Why Cookies Are Better Than Sessions - In my opinion, why browser cookies are better to use for user state management than PHP sessions.
- Folder Structuring Best Practices - Organize your root better!
- The "Almost" Perfect Smarty Setup - The Smarty templating engine is by far one of the best out there, and now you'll know how to use it perfectly.
- Some MySQL For The Brain - Good MySQL Tips and Tricks.
- Web Development Cheat Sheets - Some very sweet cheat sheets.
- Ext JS: Create A Basic Login Form - Create a really basic login form for your Ext JS application.
- Ext JS: Adding Functionality To Your Form - How to add a bit of functionality to your Ext JS login form.
Catching The ENTER Key The Cross-Browser Friendly Way (JavaScript)
If you've ever tried creating a cross-browser JavaScript function for capturing the ENTER (or whatever key code you need) key then you know about the major differences in the way each browser handles events...pain in the butt to say the least! Well, I'll go ahead now and save you some time and trouble.
The following snippet of JavaScript will catch the ENTER key (for ALL browsers checked) when it's pressed:
<script type="text/javascript">
function catchEnter(e){
var theKey=0;
e=(window.event)?event:e;
theKey=(e.keyCode)?e.keyCode:e.charCode;
if(theKey=="13"){ // 13 is the key code for ENTER
// here is where your code will go
//return false; // return false if you want to...
//...halt submission of form (call this function onsubmit)
}
}
</script>
Example Usage: call this function in the onkeyup event in the body:
<body onkeyup="catchEnter(event);"...
Example Usage: call this function in the onsubmit event in the form:
<form name="frmForm" onsubmit="return catchEnter(event);"...
This JavaScript has been tested in all the major browsers (Google Chrome, Firefox, Opera, IE, Safari, Netscape).
HOT New Web Service, SquareLeaf
I'm going to make it a regular thing here of me writing about a new web site or service which I find useful or interesting from the web. For the first of such articles I'm going to write about a new web service which I find very useful called SquareLeaf.

In the most simplest sense, Square Leaf is Post-It Notes in a web interface. You're basically given a white-board in which you can place different colored notes on it with whatever you like. Laundry list, errands, shopping list, etc etc. Whatever you'd like.
I'm a big fan of efficiency and project management and by utilizing SquareLeaf the right way makes handling those two very much easier.
It's missing a lot of features I wish it had (like, text colors, sizes, fonts, etc etc), and I hope they're at least working on these, but it's very useful already, indeed.
Bottom line:
SquareLeaf is the Post-It Notes I always wished I had.
Have A Copy of New User Welcome Message Sent to You (ASPDotNetStoreFront)
ASPDNSF Version: 9 (C# + MS SQL)
If you would like to have a copy of the new user welcome email message sent to you whenever a new user signsup to your shop, well you'd assume they would have this feature in the system already...but that's not the case. This feature is currently lacking in AspDotNetStorefront as of version 9 (ML).
No fear, Ben is here!
To enable this feature it will take a bit of C# work and some tinkering.
First, open up createaccount.aspx.cs using your favorite text editor. Then find the lines of code where the welcome message is sent to the new user...
if (AppLogic.AppConfigBool("SendWelcomeEmail") && EMailField.IndexOf("@") != -1)
{
// don't let a simple welcome stop checkout!
try
{
string body = AppLogic.RunXmlPackage(...
Now, add the following code after the try and catch...
try{
string body = AppLogic.RunXmlPackage(AppLogic.AppConfig("XmlPackage.WelcomeEmail"),
null,
ThisCustomer,
this.SkinID,
"",
"fullname=" + ctrlAccount.FirstName.Trim() + " " + ctrlAccount.LastName.Trim(),
false,
false,
this.EntityHelpers);
AppLogic.SendMail(AppLogic.GetString("createaccount.aspx.79", ThisCustomer.SkinID, ThisCustomer.LocaleSetting),
body,
true,
AppLogic.AppConfig("MailMe_FromAddress"),
AppLogic.AppConfig("MailMe_FromName"),
"youremail@yourdomain.com",
ctrlAccount.FirstName.Trim() + " " + ctrlAccount.LastName.Trim(),
"",
AppLogic.MailServer());
}catch{}
...being sure to change "youremail@yourdomain.com" to the email address where you want to receive the notifications.
Example:
if (AppLogic.AppConfigBool("SendWelcomeEmail") && EMailField.IndexOf("@") != -1)
{
// don't let a simple welcome stop checkout!
try
{
string body = AppLogic.RunXmlPackage(AppLogic.AppConfig("XmlPackage.WelcomeEmail"),
null,
ThisCustomer,
this.SkinID,
"",
"fullname=" + ctrlAccount.FirstName.Trim() + " " + ctrlAccount.LastName.Trim(),
false,
false,
this.EntityHelpers);
AppLogic.SendMail(AppLogic.GetString("createaccount.aspx.79", ThisCustomer.SkinID, ThisCustomer.LocaleSetting),
body,
true,
AppLogic.AppConfig("MailMe_FromAddress"),
AppLogic.AppConfig("MailMe_FromName"),
EMailField,
ctrlAccount.FirstName.Trim() + " " + ctrlAccount.LastName.Trim(),
"",
AppLogic.MailServer());
}
catch { }
// below added by Benjamin Eskew (Aug 25, 2010)
try{
string body = AppLogic.RunXmlPackage(AppLogic.AppConfig("XmlPackage.WelcomeEmail"),
null,
ThisCustomer,
this.SkinID,
"",
"fullname=" + ctrlAccount.FirstName.Trim() + " " + ctrlAccount.LastName.Trim(),
false,
false,
this.EntityHelpers);
AppLogic.SendMail(AppLogic.GetString("createaccount.aspx.79", ThisCustomer.SkinID, ThisCustomer.LocaleSetting),
body,
true,
AppLogic.AppConfig("MailMe_FromAddress"),
AppLogic.AppConfig("MailMe_FromName"),
"myemail@mydomain.com",
ctrlAccount.FirstName.Trim() + " " + ctrlAccount.LastName.Trim(),
"",
AppLogic.MailServer());
}catch{}
// the above added by Benjamin Eskew (Aug 25, 2010)
}
Now save the file and upload it to your server and that's that! Do realize that this is just a simple copy of the message, not a custom message sent to the administrator. In order to make something like that you'll have to create a custom XmlPackage to handle it and use that one in place of the current one in use (XmlPackage.WelcomeEmail).
As you can see from my current and previous posts, I've been working a lot with AspDotNetStorefront lately and have plans to continue posting information articles like this one here, so stay tuned!
The MS SQL and NTEXT Problem (SOLVED)
So, the other day I ran into the problem of trying to pull data from a field which was of type ntext in a MS SQL database using PHP. I'm fairly new with MS SQL and Windows IIS server environments for that matter so please bare with me. Well, I found the solution!
When you're using PHP's mssql_ functions and you need to pull data from a table field which is of type ntext you can't simply pull it using typical select methods, you need to cast the variable as another because the ntext type is not supported in PHP's mssql_ functions.
Code Which Wasn't Working:
$r = mssql_query("select ProductID, Description from myTable where id = '1'");
Solution:
$r = mssql_query("select ProductID, CAST(Description AS TEXT) AS Description from myTable where id = '1'");
