让你的博文自动带上缩址的实现代码,方便发到微博客上


复制代码 代码如下:

<script type="text/javascript">
$(function(){
c_url = 'http://s8.hk:8088/s8/s?format=text&longUrl=';
c_url += document.location.href;
c_url += '&jsonp=?'
$.getJSON(c_url, function(data){
$("<div>本文短址:</div>").css("font-weight", "normal")
.css("font-size", "12px")
.append($("<a>"+data+"</a>").attr("href", data))
.appendTo(".post .postTitle"); # 此行需要特殊处理,不过在博客园一般情况下是不用修改的。
});
});
</script>

« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3