My solution for a dynamically updating image randomizer in JavaScript
My latest focus is mastering web development, specifically ASP.Net MVC with Bootstrap and jQuery. There’s a huge amount of information to learn but none of it is particularly difficult. About the most foreign part for me has been dealing with JavaScript scope and context.
Example. I have a single page application (SPA) that is going to host an image. Every time the page updates I want to display a different image from a list at random. It’s easy to find examples on how to do this. However, the examples only work on a full page load or only for one location. Since this is a SPA there’s rarely a page load (I’m extensively using AJAX against my Web API) and I plan on more than one image list.
Here’s my solution. This was initially based on the “Chicken Dinner” plugin from http://chickendinner.sosweetcreative.com/
Continue reading