在建站时织梦cms模板中加入返回首页的js代码的方法如下
{dede:field.body/}
<span id=”arctTailMark”></span>
<script type=”text/javascript”>(function(){var obj = null;if(document.getElementById(‘arctTailMark’)) {obj = document.getElementById(‘arctTailMark’);}if(obj!=null){var str = ‘<a href=”http://www.您的网址.com” target=”_blank” id=”back_web” style=”font-weight:bold”>返回首页</a>’;var showed = 0;try{var oo = obj.previousSibling;while(oo.nodeType!=1 || oo.innerHTML.replace(/s|u3000/g,”).length==0){oo = oo.previousSibling;}if(oo.nodeType==1 && oo.tagName.toLowerCase()==’p’) {var span = document.createElement(‘span’);span.innerHTML =str;oo.appendChild(span);showed = 1;}}catch (e){}if(showed == 0){obj.innerHTML =str;}}})();</script>
本文来自网络