The HTML 5 Canvas has to be one of the coolest features that has been introduced in quite some time. Solid and well built, it makes image editing and modification such a breeze compared to the javascript-based tools we had in the past. There are bound to be some useful wrapper libraries out there that…
I am able to add a jpg image to a pdf document using insert image but for some reason the code throws an error when I try to add a png image. Why would this be failing? This is the error that I see getting thrown Error in function n/At: String contains an invalid character…
Performing analysis on content that a user is typing is a common requirement for interfaces. A simple word counter, for example, will need to bind to an event so that it can scan the text when the user has modified the data. There are ways to do this using jQuery, but what if you want…
I have a json string that is a regular raw string and job a javascript object. How do i load this json into a javascript object so that I can use it normally?  var jsonStr = "{\"property1\": \"test\", \"property2\": \"something else\" }"; alert(loadedJson.property1); The example above is a basic idea of what I am trying…
Calculating the length of a string is a very simple thing to do in most programming languages. It is an action that you will find yourself needing to perform very often. Be it for validation, reporting or comparisons, knowing how to find how many characters a piece of text has using code is incredibly useful.…
I am using JsPDF and I want to add an image to a pdf document. I have followed the examples from the code and it seems fairly simple to make it work. For some reason I am getting a console error when I try to perform this. The error reads "addImage is not a function".…
I have a canvas window and there is an element that i want to programmatically add to it. If a user adds a background image, i want to be able to toggle a semi transparent overlay that makes the text above stand out more clearer and is the main focus instead of it being the…
I have an array of items where they are key value pairs. I want to select one at random, but I do not know how to get the key for a random item in the array. I can use Math.random() to generate a random index but how do i get the key? Here is the…
If you are using the sortable feature of the jQuery library, you will likely want a way to get the order of the elements. You can do this very easily using one of the built in events. The following code will obtain the element order for a sortable div and output the data to the…