gi;
var text html.replaceSCRIPTREGEX, ; 正则替换为空
var arr text.split;
ifarr0 推荐成功
推荐成功提示
var num parseIntrecommendcount.text;
returnqcrecommend5.textarr0;
推荐数加1
recommendcount.textnum1;
推荐人显示
ifrecommendcount.text
recommendtag.html推荐人;
recommendbody.htmlarr1;
else
recommendbody.appendarr1;
渲染分享代码
shareblog.html;
jquery写法
var commentcid window.location.hash;
var commentcid commentcid.slice1;
ifcommentcid
jQuerycommentcid.parent.animateheight toggle, opacity toggle, fast;
jQuerycommentcid.parent.prev.hide;
window.onload function js写法
找到锚点
var commentcid window.location.hash.toString;
var commentcid commentcid.slice1.toString;
var theNode document.getElementByIdcommentcid;
iftheNode.hasChildNodes
iftheNode.childNodes.length1
alerttheNode.firstChild.nodeType;
theNode.style.backgroundColor E6E6B8;
theNode.previousElementSibling.style.marginBottom 0px;
theNode.previousElementSibling.style.backgroundColor E6E6B8;
theNode.previousElementSibling.previousElementSibling.style.backgroundColor E6E6B8;
window.scrollTo0, theNode.offsetTop100;
return false;
获取第一个子节点
var firsttheNode.children0;
first.style.backgroundColor E6E6B8;
获取父节点元素
var prent theNode.parentNode;
prent.style.display block;
前一个元素节点
var pre prent.previousElementSibling;
pre.style.display none;