Adam K Dean

Posts

Get length of associative array in JavaScript

Published 2 January 2014 in archive with tags javascript Something I learnt just now is that JavaScript is funny about arrays. Unless you're using numerical indexes, your array elements will actually become properties of the underlying object. It sucks, but it also kind of makes sense. Continue reading …

Circular images with CSS

Published 19 December 2013 in archive with tags css A trend which, while it has been around for a while, seems to be showing up more and more these days is circular images. These are quite easy to do using border-radius, and below you can see how. You can either use a background-image in CSS, or add the border-radius to an img tag, which I prefer. Continue reading …

Replace anchor tags with square bracket format

Published 18 December 2013 in archive with tags regex , csharp For reason I won't go into, I have just found myself needing to replace a lot of anchor tags with square bracket format anchor tags, like so: Continue reading …

Detect when ng-options has finished rendering

Published 10 December 2013 in archive with tags javascript , angular If you want to fire an event when ng-options finishes rendering options, you can do so by watching the model with scope.$watch and then queuing up the event code to fire on the next digest cycle with scope.$evalAsync. Like so: Continue reading …

Remove params from URL in JavaScript

Published 3 December 2013 in archive with tags regex , javascript Let us say the param we want to remove is session and our URL is http://www.example.com/?session=lasgfnasolgnasgn&id=500&other=100. We can remove it like so: Continue reading …



Newer Page 24 of 42 Older