【发布时间】:2018-06-10 21:51:55
【问题描述】:
此脚本不适用于 Bloggger 自定义域 Cloudflare 免费 ssl 上的 https。它可以在 https 关闭时运行,但不适用于 https。
在首页显示文章描述的脚本。
$(document).ready(function($) {
$('.post-summary').each(function() {
var summary = $(this),
getURL = summary.attr('data-url');
$.get(getURL, function(data) {
var text = $(data).find('.post-body').text().substr(0, 250);
summary.html('<p>' + text + '...</p>');
}, "html");
});
});
上述脚本的 HTML:
<div class='resumo'>
<span class='post-summary' expr:data-url='data:post.url'/>
</div>
<div style='clear: both;'/>
<a class='read-more anchor-hover' expr:href='data:post.url'>Read More</a>
</div>
【问题讨论】:
标签: javascript jquery http https blogger