Removing slight jQuery Dependencies

  • $(document).ready(function () {
    • Turns Into:
    • function r(f){/in/.test(document.readyState)?setTimeout(‘r(‘+f+’)’,9):f()}
    • r(function(){
      • test for the presence of the string “in” inside the string response of document.readyState
      • then, waits for 9 ms and reruns its own call
  • var canvasHtml = $(‘<canvas width=”‘ + 500 + ‘” height=”‘ + 500 + ‘”></canvas>’);
    • Turns Into:
    • var canvasHtml = document.createElement(‘canvas’);
    • canvasHtml.setAttribute(“width”, “500”);
    • canvasHtml.setAttribute(“height”, “500”);
  • $(‘body’).append(canvasHtml);
    • Turns Into:
    • document.getElementsByTagName(‘body’)[0].appendChild(canvasHtml);
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s