Category: JavaScript

Javascript: References to out-of-scope variables.

In JavaScript, referencing variables that are declared outside of a function’s scope can be tricky. If you have code like this: <script> var btn = document.getElementById("BTN"); var test = 1; btn.onclick = function() { alert(test); } test = 2; </script><script> var btn = document.getElementById("BTN"); var test = 1; btn.onclick = function() { alert(test); } test = 2;…

Read the full article

In Progress, But Sleepy

As it may mention in the page title, I’m currently screwing around with the blogger template, so this blog may look a bit…um…screwy for a while. I’ve been wanting to toy around with Javascript hacks to extend the Blogger template functionality. The first thing I did was add some Javascript that allows you to show/hide…

Read the full article