我正在尝试在Blogger模板中使用此脚本来启用对box之类的facebook的夸张。但是当我尝试在上面粘贴此代码时(因为我找不到标签)。然后单击“保存”,此错误将显示为红色。有人可以纠正我所缺少的吗。难道这代码真的会影响我的页面速度吗?该代码的参考网址是http://hayageek.com/jquery-lazy-loading-scripts/,该代码是
**in head section:**
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="jquery.lazyscript.js" type="text/javascript"></script>
**in body section:**
<script>
$(document).ready(function () {
var options = {
type: "scroll",
scripts: [
"http://platform.twitter.com/widgets.js",
"http://connect.facebook.net/en_US/all.js#xfbml=1&appId=445577382175430",
"https://apis.google.com/js/plusone.js"
],
success: function () {
FB.init({ status: true, cookie: true, xfbml: true });
}
};
$.lazyscript(options);
});
</script>
我已将您的代码转换为与博客兼容,请使用以下脚本,它将不会显示任何错误:
<script>
$undefineddocument).readyundefinedfunction undefined) {
var options = {
type: "scroll",
scripts: [
"http://platform.twitter.com/widgets.js",
"http://connect.facebook.net/en_US/all.js#xfbml=1&appId=445577382175430",
"https://apis.google.com/js/plusone.js"
],
success: function undefined) {
FB.initundefined{ status: true, cookie: true, xfbml: true });
}
};
$.lazyscriptundefinedoptions);
});
</script>
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句