To copy/clone an object using JavaScript, you will want to leverage the JSON.parse function in combination with the JSON.stringify function.
Category: Development
-
Experimenting with the canvas for a basic walk animation
I don’t claim to be an animator, JavaScript array expert, or anything else; I simply wanted to explore the canvas tag in HTML5. In the following article, I demonstrate how to create a simple walking animation using a free sprite that I found on the Internet.
Before I show the solution, I’m going to start with the finished product. Like I stated, it’s extremely basic and not the most overly exciting thing in the world. But from a person who has been creating web applications for 10 years, I found it pretty cool.
-
Deep clone an object with jQuery
To copy/clone an object using jQuery, you will want to leverage the extend function. This function accepts N objects to clone/merge as well as a boolean to indicate whether it should copy recursively or not.
-
jQuery: Global AJAX Events for Start, Stop, Complete, or Error
When your website contains a lot of AJAX requests using jQuery template and you want to add a global event at the start or finish of the AJAX request, e.g. add a spinning icon, or handle all AJAX errors in a particular fashion.
The jQuery library provides multiple events for ajax event handlers. This article will focus on ajaxStart and ajaxError.
-
Cannot find module (SNMPv2-TC)
When I run PHP via the command line (aka php cli), I often would be spammed with the following error messages:
Cannot find module (SNMPv2-TC)
Cannot find module (SNMPv2-SMI)Messages like this would repeat for 30 or 40 lines. These errors would not stop my command from executing; however, it was extremely noisy when trying to see the output.