Posted By

hebertialmeida on 02/17/11


Tagged

php jquery CDN


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

uberdragon


jQuery dynamic Google CDN with PHP


 / Published in: PHP
 

  1. <?php
  2. /*
  3. * Put this in your config file
  4. */
  5.  
  6. function jQuery($v){
  7. echo ($v ? "<script src=\"https://ajax.googleapis.com/ajax/libs/jquery/".$v."/jquery.min.js\" type=\"text/javascript\"></script>" : "<script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js\" type=\"text/javascript\"></script>");
  8. }
  9.  
  10.  
  11.  
  12. /*
  13. * Put this in all pages
  14. */
  15.  
  16. // Default version
  17. jQuery();
  18.  
  19. // Version specifies
  20. jQuery("1.4.2");
  21.  
  22. ?>

Report this snippet  

You need to login to post a comment.