Keep Original Variable State Between Event Binding and Execution

I wrote an article on the Foliotek Development Blog about saving the state of a variable inside a closure that is not executed immediately. For example, functions passed into event binding or setTimeout(). Here is a quick rundown of the problem and the solution (using the jQuery library).

Read more →

jQuery outerHTML Snippet

outerHTML is a property that is provided by Internet Explorer that returns the full HTML of an element (including start and end tags). In jQuery, the html() function returns the innerHTML of an element, which is just the HTML inside the element (not including the start and end tags).

Read more →

Extending jQuery to Select ASP Controls

One thing that has always been annoying about programming JavaScript in an ASP.NET Web Forms environment is that the ID attribute of HTML controls rendered out from ASP controls is unpredictable.

Read more →

A* Search Algorithm in JavaScript

Note that this code has been updated. I have an updated blog post detailing what changed. The new source code is available at https://github.com/bgrins/javascript-astar, and the code as of the original post is still available here: https://github.com/bgrins/javascript-astar/tree/0.0.1/original-implementation

Read more →

Multipart Form Post in C#

I recently had to access a web API through C Sharp that required a file upload. This is pretty easy if you have an HTML page with a form tag and you want a user to directly upload the file.

Read more →

C# Tips - Null Coalescing ??

I have always enjoyed using the logical OR operator in JavaScript (||) as an oppurtunity to check for a null-like value, specifically to provide default parameters for functions or to check for existence of a property on a collection. I think they are a great way to make code more concise, and if used well, more readable.

Read more →