load_jquery_on_ie.html 575 B

123456789101112131415161718
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>Load jQuery if Zepto is not supported</title>
  5. </head>
  6. <body>
  7. <h1>Load jQuery if Zepto is not supported</h1>
  8. </body>
  9. <script>document.write('<script src='+('__proto__' in {} ? '../dist/zepto' : 'https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery')+'.js><\/script>')</script>
  10. <script>
  11. $('body').append('<p>Hello from '+('Zepto' in window ? 'Zepto' : 'jQuery')+'!</p>')
  12. $('script').each(function(index,script){
  13. if (script.src)
  14. $('<p>&lt;script src="'+script.src+'"&gt;</p>').appendTo('body')
  15. })
  16. </script>
  17. </html>