Return to Snippet

Revision: 9000
at October 26, 2008 18:38 by demixo


Updated Code
/*DOM Scripting*/
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

function mostrarVentana(){
	alert('Hola mundo sin jQuery');
}

addLoadEvent(mostrarVentana);


/*jQuery*/
$(document).ready(function(){
	alert('Hola mundo con jQuery');
});

Revision: 8999
at October 16, 2008 22:38 by demixo


Initial Code
/*DOM Scripting*/
function mostrarVentana(){
	alert('Hola mundo sin jQuery');
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

addLoadEvent(mostrarVentana);


/*jQuery*/
$(document).ready(function(){
	alert('Hola mundo con jQuery');
});

Initial URL

                                

Initial Description

                                

Initial Title
DOM Scripting vs jQuery 1: "Hola mundo"

Initial Tags
javascript, DOM, jquery

Initial Language
JavaScript