Tag: javascript

  • What is a Self Invoking Function

    What is a Self Invoking Function

    In JavaScript, it’s common to hear lots of strange terminology without a lot of description around what it is or what it does. I want to try and demystify what a self invoking function is and why you should consider them and the times when maybe you shouldn’t consider them.

  • Why JavaScript

    Why JavaScript

    In the earlier days of the web, there was a battle between two scripting languages VBScript and JavaScript. VBScript, thankfully, eventually died and JavaScript became the dominant language for making really easy to use and interactive websites. In the years since, JavaScript has become more and more used. Backend code can be written in basically […]

  • How to Use Reduce on JavaScript Arrays

    How to Use Reduce on JavaScript Arrays

    In functional programming, being able to reduce is one of the fundamental concepts. Reduce is used to iterate through the values in an array and condense all of the values into a single value. Usually the value is a sum of all of the elements, but it could be used to decrement, multiply or even […]

  • Detecting Inactivity in JavaScript

    Detecting Inactivity in JavaScript

    In a lot of web applications, it can be really useful to detect whether the user is still active or not. For example, when a user is no longer active it can make a lot of sense to automatically log the user out or remind them that they’re about to be logged out.

  • How to merge Objects together in JavaScript

    How to merge Objects together in JavaScript

    Merging objects together in JavaScript isn’t very difficult although there’s quite a few different ways that it can be done. Note, I’m not covering deep cloning for the sake of simplicity although this can be easily done through most of these different methods.

  • How to get the URL Parameters in JavaScript

    How to get the URL Parameters in JavaScript

    It’s no secret that JavaScript is now all around us, most html forms are using JavaScript for validation and of course there’s now JavaScript on the server. This post covers how to get the query string from the current page’s url.

  • 5 Resources for Learning JavaScript

    5 Resources for Learning JavaScript

    Traditionally when somebody said JavaScript, they were talking about a language that just did stuff on the client side like form validation or the occasional animation or UI enhancement. For years now, JavaScript has been all of the rage. Most new technology startups are now using JavaScript on the frontend, and on their backend services.

  • Updating Salesforce Records Using JavaScript

    Updating Salesforce Records Using JavaScript

    Over the last few years, Salesforce has made some really significant changes that allow JavaScript to increasingly be used. By using Salesforce’s AJAX toolkit it’s possible to do an incredible amount of customization to a standard Salesforce Page Layout without ever having to write any apex.

  • Avoiding Globals in JavaScript

    Avoiding Globals in JavaScript

    JavaScript uses functions as the primary way to define scope any variable defined inside of a function is in the local scope. A variable defined outside of a function is in the global scope.

  • Sorting Elements in an Array Alphabetically in JavaScript

    Sorting Elements in an Array Alphabetically in JavaScript

    There’s a lot of reasons why you may want to sort an array, often it is done to make things easier for the user of the application to understand the data. Arrays are normally sorted to be in ascending order (or alphabetical).

  • Recreating PHP’s time() function in JavaScript

    Recreating PHP’s time() function in JavaScript

    PHP’s time() function returns the current unix timestamp. JavaScript doesn’t exactly have the same functionality, but it’s pretty close. Put a different and more understandable way, it returns the current time measured in seconds since the Unix Epoch (00:00:00 UTC on 1 January 1970). JavaScript has a similar way of getting the time but it’s in milliseconds since the Unix Epoch.

  • JavaScript IsNumeric Function

    In the past, there’s been so many times I needed to tell if an object was numeric. With the below function, it’s very easy to tell if an item is numeric. If your project is already using jQuery, you could always use jQuery.IsNumeric()

  • How to Remove the Annoying VIP Zone Video from the Niagara Falls Review

    Ever wonder about how to Remove the Annoying VIP Zone Video from the Niagara Falls Review’s website? I absolutely love following local news, but I really can’t stand being forced to pretend I’m going to watch a video.

  • Resource interpreted as other but transferred with MIME type text/javascript.

    When I was looking at a site with the Chrome Developer Tools, it had a little error icon that said “Resource interpreted as other but transferred with MIME type text/javascript” when I clicked it. I couldn’t figure out my error at first, but eventually realized I had for some reason had a script tag with […]

  • Dealing With Dates in JavaScript

    Dealing With Dates in JavaScript

    Dates and DateTimes are difficult to deal with in most languages. The Date object is a datatype that’s built in the JavaScript language. In JavaScript, the biggest problem is that the browsers aren’t overly consistent in the way they have implemented the Date object and its APIs.

  • Disabling Caching on All AJAX in jQuery

    It’s no secret that many of us that use javascript regularly love jQuery because it handles a lot of the cross browser issues and makes our lives so much easier. The .ajax function makes use of caching by default, but we can override this by creating a function called .ajaxSetup and adding cache: false in […]

  • How to Add CSS & JavaScript to a Magento CMS Page

    Magento is an insanely flexible system that has a lot of potential, but of course with this flexibility comes a lot of learning. Adding a JavaScript file and a CSS file to a specific CMS page isn’t very difficult. We should always consider adding the JavaScript file or CSS file to the theme if we’re […]

  • Coders at Work: Reflections on the Craft of Programming

    Coders at Work written by Peter Seibel is a fantastic book of interviews of fifteen very famous programmers. Audience of the book is clearly programmers with experience programming as the book can at times get fairly rich with technical details about compilers, IDE’s, etc.

  • Component returned failure code: 0x805e000a

    Error: uncaught exception: [Exception… “Component returned failure code: 0x805e000a [nsIXMLHttpRequest.open]” nsresult: “0x805e000a ()” AdBlock interferes with the XmlHTTPRequest object and is known to sometimes break the way jQuery functions especially if the url triggers some sort of url filter. You have a few options to resolve the solution: suggest that users turn off AdBlock if […]

  • Book Review: jQuery in Action

    Book Review: jQuery in Action

    jQuery in Action, First Edition is written by Bear Bibeault and Yehuda Katz and is probably the simplest and easiest to understand programming book available. Target reader is somebody that already is using javascript in projects and is looking to push the limits of their web applications by using jQuery and many of it’s great […]