Even with all the information on the web today, it can be difficult to find current information on JavaScript sometimes. There are a few good web magazines out there, but none truly focus solely on JavaScript related topics. I recently found an online magazine called JsMag.
The magazine has some great information on topics such as Ajax, code optimization, mashups, jQuery, web application testing, event handling, EXT JS, OOP, and much more. Its unique content, focusing on mainly JavaScript related topics, keeps me continously learning new things in the JavaScript world. Talented developers write different articles each month so content is always new and comes from different perspectives.
The monthly issues (.pdf) are only $4.99 or you can purchase a years subscription as well. It definitely is worth the small investment if you are a JavaScript developer or interested in learning more intermediate to advanced JavaScript topics.
I’m not a fan of creating a script that only works in one browser or differently in other browser(s). I had to create a link on a website for work that made a URL their home page. This annoying task proved difficult as there wasn’t much good information online and it seems only IE allows this. The Firefox browser will only allow you to make a web page a ‘favorite’.
So I found the code to make it work on both IE and Firefox (will not work on any other browser), as well as improving its ‘unobtrusiveness’. As you can see from the code, I only display the link if the browser is either Internet Explorer or Firefox otherwise the link text is blank.
The ‘Browser.Detect’ object is from a script from the JavaScript guru himself, PPK which detects what browser the visitor is using. Browser detection isn’t used as much today as it once was but it is still needed on some occasions.
read more…
DHTML is a buzzword that came onto the scene during the version 4 browsers and tried to bring the “sexy back” to web development. Even though web standards, accessibility and unobtrusiveness were still in their infantcy, it did make the web world more aware of what you could do on the client (browser) before sending data to the server.
Even though the defintions of DHTML may never be totally accurate (the changing of the styles of HTML elements by means of JavaScript), if we can take what we have learned in the past and apply them now we can get a very thorough understanding of what JavaScript can do.
This e-book (.pdf) and example code (.zip) covers some topics I covered on this website as well as many others I have not, such as: the DOM, table sorting and highlighting, regular expressions, hide-show, pop-up windows, form validation and formatting, alertless error messages, date picker, google maps, and ajax basics.
Marijn Haverbeke has put together an online book titled Eloquent JavaScript that not only has some nice content, but also incorporates a really cool integrated interface for editing and running the example programs.
I would categorize these lessons as beginner to advanced so there is something for every level of developer.
read more…
Chris Heilmann created a nice DOM Cheatsheet (.pdf) to help all us would-be JavaScript developers.
Nowadays there are many elaborate ways to create navigation to access pages on your website. Back in the early days of JavaScript, “Jump Menus” were used a lot to create simple navigation to various web pages. These have been replaced by more elaborate JavaScript menu systems that use hundreds of lines of code. This technique can still come in handy in certain situations and is good practice for anybody wanting to learn.
read more…
The visibilty of an element is a powerful tool that can be used in JavaScript to create everything from animations and effects to fast templating. More importantly, however, it can also be used to quickly hide an element from view, providing users with some basic user interaction capabilities.
Within CSS there are two different ways of effectively hiding an element from view; both have their benefits but can provide unintented consquences, depending on how you use them:
read more…
Every element in a document is an object. Every one of these objects has a whole collection of properties as we have discussed in previous meetings. There’s one property called style which every element node has. It contains information about the styles attached to the element. Querying this property doesn’t return a simple string, it returns an object. Style information is stored as properties of this style object:
element.style.property
read more…
Depending on the browser type and configuration, pressing the Enter key while in a form does not always submit the form. Sometimes, for instance, the button that submits the form resides in another frame. In that case, adding a bit of JavaScript to ensure that the Enter key sends the form data, as well, comes in handy.
read more…
Inside every function in JavaScript there exists a contextual variable named arguments that acts like a pseudo-array. This object contains all the arguments passed in to the function. Arguments isn’t a true array (meaning that you can’t modify it, or call .push() to add new items), but you can access items in the array, and it does have a length property.
read more…