Kilho.net
信息技术 随笔

从 Google 获取并使用 jQuery

由于流量原因,把图片和 Flash 文件移到了其他服务器并链接过去

浏览网页时发现了下面这段代码,于是将 jQuery 连接到 Google

修改的文件:主题/functions.php

[PHP]
//Making jQuery Google API
function modify_jquery()
{
if (!is_admin())
{
// comment out the next two lines to load the local copy of jQuery
wp_deregister_script(‘jquery’);
wp_register_script(‘jquery’,
‘http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js’, false,
‘1.4.4’);
wp_enqueue_script(‘jquery’);
}
}
add_action(‘init’, ‘modify_jquery’);
[/PHP]

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注