Category: Programming

  • How translate.google.com works

    Actually, this is not about how translate.google.com works. It’s about loading HTML from a random URL, adding some extra Javascript and CSS and redisplaying the page on a different domain. A simple test page I’ve made a simple test web page: Hello world Let’s translate it with Google Translate. The translation page has two iframes […]

  • SOLR with JSONP with JQUERY

    Update: The previous version of this howto was a bit unclear or even erroneous, and some people had problems getting it to work. I have now rewritten it and testet it with SOLR 3.5.0 and jQuery 1.7.1. Making SOLR return results suitable for consumption using JSONP is very easy! Calling SOLR in JSONP style Enter […]

  • 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 […]

  • 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.