Skip to main content

Posts

Showing posts from February, 2014

JavaScript Did You Know? #Ramblings

I've been told on more than one occasion that I tend to ramble. But then again who doesn't from time to time ey? What I meant to ramble on about were some interesting JavaScript constructs, patterns, code .. etc
Self Executing Anonymous Functions and Document.Ready While they can be really helpful, its always important to understand how and when they get executed. In case you'd like to know more about Self Executing Anonymous functions, here's a post by Mark Dalgleishhttp://markdalgleish.com/2011/03/self-executing-anonymous-functions/

<div class="before">
Before Div. This content will change!
</div>
<script>
(function () {
$(".before").html("Since the div is declared before the script block, its loaded and we're able to manipulate it.");
$(".after").html("The div declared after the script block is not yet loaded, we're not able to do anything!");
})()
</script>
<div cla…