Helping you solve those tough coding problems!
Learn some great web development and web design tips and techniques through recipes that clearly define the problem being solved with a working solution.
Popular Tags: cakephp | theory | optimization | javascript-development | asp-net | css | jquery-development | sql | ajax | c

Search:
Follow @endyourif rss Facebook LinkedIn

Using a forEach loop with JavaScript Using a forEach loop with JavaScript

Published on Apr 7, 2019 by Jamie Munro

I honestly feel like I've been living in the stone age. For years I've always used a standard for loop when iterating a JavaScript array accessing the property with the index of my for loop. No longer, it's time to upgrade (my brain) and use the forEach loop.

Read more >

Tags: Javascript | foreach | JavaScript

Difference between location.href and location.replace Difference between location.href and location.replace

Published on Feb 9, 2018 by Jamie Munro

It's quite common to redirect a user visiting your webpage, more specifically when they perform an action, such as: clicking a button. When the user completes the action and you want to redirect the user to somewhere else, you have two common choices:

window.location.href = '';



OR

window.location.replace('');



Read more >

Tags: Javascript | JavaScript | location.href | location.replace

Retrieving query string variables with JavaScript Retrieving query string variables with JavaScript

Published on Feb 8, 2018 by Jamie Munro

This is not something I use everyday. Seems more like a once a year thing. Last time I needed to extract query string variables, I used the old school approach with a regular expression. Now that I need to do this again, I can use the new school approach: URLSearchParams.

The URLSearchParams (at the time of writing) is not yet standardized in the W3C; however, most modern browsers recognize it.

Read more >

Tags: Javascript | JavaScript | regexp | urlsearchparams

Zero Padding a Number with JavaScript Zero Padding a Number with JavaScript

Published on Feb 7, 2018 by Jamie Munro

This morning I had to format a date using JavaScript as follows: yyyymmdd requiring both the month and day to include a leading zero when the month or day was less than 10. This solution using slice multiple times.

Read more >

Tags: Javascript | JavaScript | slice

Knockout - Uncaught ReferenceError: Unable to process binding Knockout - Uncaught ReferenceError: Unable to process binding

Published on Oct 27, 2014 by Jamie Munro

If you've used Knockout.js in your project, at some point or another you've probably encountered the following error "Uncaught ReferenceError: Unable to process binding". The most likely cause is a typo somewhere or forgetting to change the context. E.g. you are within a foreach binding and forget to use $parent.

I recently encountered this issue and could not find the typo anywhere. Like most developers in my situation I was getting really frustrated, banging my head against the world looking for answers.

Unfortunately, there is no easy answer to this bug; however, I can suggest an excellent technique that will hopefully help point you in the right direction.

Here is a complete example that creates a table and displays a list of books within the table. There is an unfortunate typo within one of the td data bindings.

Read more >

Tags: Javascript | KnockoutJS | knockoutjs | data binding | debugging

Javascript, the Back Button, and Windows Phone 8 Development Javascript, the Back Button, and Windows Phone 8 Development

Published on Feb 18, 2013 by Jamie Munro

JavaScript: Easy Creation of "Countdown Timers" JavaScript: Easy Creation of

Published on Aug 28, 2012 by Jamie Munro

Maintaining the back button with AJAX Maintaining the back button with AJAX

Published on Dec 28, 2010 by Jamie Munro

Facebook Development - Quick and Easy Dialogs Facebook Development - Quick and Easy Dialogs

Published on Jun 10, 2009 by Jamie Munro

Drag and drop with animations in jquery Drag and drop with animations in jquery

Published on Mar 10, 2009 by Jamie Munro

Fixing slow drag and drop with scriptaculous Fixing slow drag and drop with scriptaculous

Published on Feb 18, 2009 by Jamie Munro

Drag and Drop with AJAX Example Drag and Drop with AJAX Example

Published on Feb 14, 2009 by Jamie Munro

YSlow - Helping slow web pages load faster YSlow - Helping slow web pages load faster

Published on Feb 11, 2009 by Jamie Munro

Firebug - A developer's best friend Firebug - A developer's best friend

Published on Feb 11, 2009 by Jamie Munro