What, who, where am I?!?
Craig Lotter is a web developer based in Gordon's Bay, South Africa, who seems completely incapable of shaking off that pesky inner child within, the one that forces him to love all things animated or hand drawn.
The Rugged Rock of Craig contains snippets of his life, popular culture and all the important things like anime, manga, games and comic books. The CodeUnit of Craig on the other hand contains the more serious stuff like code snippets and tutorials, while the House of C chronicles his foray into the world of web comics.
For which it never seems he has enough time anyway.
CodeUnit Post Archive
Rugged Rock Studio
Tag Archives: javascript
Javascript: How to Force a Page Reload and Jump to a Specified Anchor Name in the Process

Anchor names are a great little browser extra that allows you to quickly jump to different sections on a web page courtesy of a handy little # declaration in the page URL. However, these do sometimes get in the way, … Continue reading
Posted in Javascript
Tagged anchor name, javascript, page jump, refresh, reload, window.location
Leave a comment
JavaScript: Grab a part of a String with the Substring Function!

Considering I work with PHP day in and day out, it is no wonder that I completely forgot that JavaScript also comes up with its super handy substring function, for when you need to grab only a specific part of … Continue reading
Posted in Javascript
Tagged javascript, javascript method, partial string, string, string extract, substring
Leave a comment
JavaScript: Execute a Function every Couple of Seconds with setInterval

With pages being very much dynamic these days, developers often need a page to do something every now and then, so as to keep the viewer’s attention or to update the page without having to do a page reload – … Continue reading
jQuery: Get the Text for a Currently Selected List Option instead of the Option Value

If you develop websites and work with JavaScript, but have never heard of jQuery before, then it is probably best that you start reading up on it right now. After all, as they like to put it themselves, jQuery is … Continue reading
Posted in jQuery
Tagged :selected, dropdown list, javascript, jQuery, option text, option value, select, select list
Leave a comment
JavaScript: Calculate the Number of Days in a Month

A simple way to calculate how many days are in a month in Javascript is to leverage Javascript’s built in date overflow feature – basically if you give it an incorrect date it automatically adjusts it to the correct one by assuming that the overflow are days which need simply to be added to the given date. Continue reading
Posted in Javascript
Tagged calendar, date, javascript, month, month end, number of days, time
Leave a comment






