How to load Javascript dependencies dynamically

Loading jQuery using plain Javascript:: // inject e.g. jQuery into a webpage var thescript = ‘http://code.jquery.com/jquery-latest.min.js’; var newscript = document.createElement( ‘script’ ); newscript.setAttribute( ‘src’, thescript ); newscript.setAttribute( ‘type’, ‘text/javascript’ ); var head = document.getElementsByTagName(“head”)[0]; head.appendChild(newscript); To call this from your script with a test to see if jQuery is loaded: // Test if jQuery is […]

How to load Javascript dependencies dynamically Read More »

jQuery ASCIIMATION plugin

Today I’ve authored a simple plugin for jQuery that does ASCIIMATION. It was inspired by the classic Star Wars asciimation. You can have a look at the google code repository for jQuery asciimation or check out the online demo starring a spinning planet Earth. I’m going to use it in an upcoming demo project.

jQuery ASCIIMATION plugin Read More »

Turning big hard problems into smaller, less hard problems.

Here I have captured a thought process I had while reading about algorithms for hard graph problems. The thoughts are inspired by MapReduce, distributed merge sort and the more colorful newspapers of the world. Summary of thoughts Given an instance of an problem (think Max Clique, Traveling Salesman or another hard graph problem)… Thought 1:

Turning big hard problems into smaller, less hard problems. Read More »