How do I initialise JQuery on Tumblr? [closed]

这一生的挚爱 提交于 2019-11-29 13:06:21

If you want to use the power of the jQuery javascript library in your Tumblr theme and you don’t want to host the jQuery library on your own server then you should consider the Google AJAX Libraries API. The AJAX Libraries API is a content distribution network and loading architecture for the most popular, open source JavaScript libraries.

Put the following snippet (based on this article) in the head tag of your theme and you’re ready to go:

<script type="text/javascript" 
    src="http://www.google.com/jsapi"></script>

<script type="text/javascript">
  google.load("jquery", "1.3");
  google.setOnLoadCallback(function() {
    jQuery(function($) {
      // do some stuff here, eg load your tweets, ...
    });
  });
</script>

source

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!