JSONP with jQuery and ASP.NET

JSONP allows you to execute something similar to AJAX, across domains without worrying about whether the request is across domains, or any special CORS configuration. It’s not generally a huge deal to set up CORS, but JSONP is guaranteed to work in all browsers and servers without any special handling. Javascript ASP.NET

jQuery noConflict

If you need to inject a specific version of jQuery into a webpage that may or may not already have a different version of jQuery, or if you specifically need two different versions loaded, then you can use jQuery.noConflict. You might use this if you’re building a custom control that gets injected into a page,…

jQuery AJAX

I’m sure there’s a perfectly good explanation for why the “always” function has two different signatures – one for requests that were successful and a different one for unsuccessful ones. But whatever their reason, they’re wrong. This is just plain stupid that you don’t know what kind of object the first and third parameters are.…

Add EXIF date to photo

If you have a photo that you need to add a timestamp to the EXIF information, you can use the following .NET code. Apparently there are a ridiculous number of formats and standards which are incompatible with each other and conflicting, but from what I’ve found, this should cover regular use cases. I’m sure there’s…

GZip with Pako

GZip is a super-fast compression technique, usable anywhere. In javascript, you can use the Pako library to compress your data. Browser NodeJS

Javascript GUID

If you need a GUID in Javascript, here are samples for building your own, either in a browser setting, or using NodeJS where you can easily add more features. In Browser NodeJS Technically this isn’t a proper GUID, but it is 16 cryptographically-pseudorandom bytes and works just fine if you need something that fits into…

Destructuring in javascript

Used to extract values from arrays and objects and assign to variables, making it easier for callers to see what they need to pass in to the function Browser Support No IE support, requires a real browser

Javascript does element have class

If you need to check if an element has a given class, there are a few ways. jQuery has a hasClass function. If you’re limited to users using IE10 or a real browser, then you can use the Element.classList property. But if you have to cater to old IE users, and aren’t using jQuery, then…

Loading…

Something went wrong. Please refresh the page and/or try again.


Follow My Blog

Get new content delivered directly to your inbox.