Posted By

demixo on 10/16/08


Tagged

javascript DOM jquery scripting


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

jamesming
Scooter


DOM Scripting vs jQuery 1: "Hola mundo"


 / Published in: JavaScript
 

  1. /*DOM Scripting*/
  2. function addLoadEvent(func) {
  3. var oldonload = window.onload;
  4. if (typeof window.onload != 'function') {
  5. window.onload = func;
  6. } else {
  7. window.onload = function() {
  8. oldonload();
  9. func();
  10. }
  11. }
  12. }
  13.  
  14. function mostrarVentana(){
  15. alert('Hola mundo sin jQuery');
  16. }
  17.  
  18. addLoadEvent(mostrarVentana);
  19.  
  20.  
  21. /*jQuery*/
  22. $(document).ready(function(){
  23. alert('Hola mundo con jQuery');
  24. });

Report this snippet  

You need to login to post a comment.