一次在生成動易網校的“網校新聞”欄目時候,生成時發現問題,經過自己的測試片刻之后得于解決,剛好想起以前也有朋友問起這個問題,順便做個幫助文章,供需要的會員參考:
本次我是對模板做優化的時候進行生成行為,所以必須對模板生成之后的代碼進行檢查。
我的內容頁模板(片段,截到head區):
以下是代碼片段: 〈html〉 〈head〉 〈title〉{$PageTitle}-動易網校,最齊全的動易模板,動易插件,動易教程站〈/title〉 〈meta name="Keywords" content="{$PageTitle}-{$Keyword}"〉 〈meta name="Description" content="{$PageTitle}-{$Keyword}"〉 〈meta http-equiv="Content-Type" content="text/html; charset=gb2312"〉 〈style type="text/css"〉 〈!-- .style2 { color: #FF0000; font-weight: bold; } --〉 〈/style〉 {$Skin_CSS} {$MenuJS} 〈script language="JavaScript" type="text/JavaScript"〉 //改變圖片大小 function resizepic(thispic) { if(thispic.width〉700) thispic. } //無級縮放圖片大小 function bbimg(o) { var zoom=parseInt(o.style.zoom, 10)||100; zoom =event.wheelDelta/12; if (zoom〉0) o.style.zoom=zoom ’%’; return false; } //雙擊鼠標滾動屏幕的代碼 var currentpos,timer; function initialize() { timer=setInterval ("scrollwindow ()",30); } function sc() { clearInterval(timer); } function scrollwindow() { currentpos=document.body.scrollTop; window.scroll(0, currentpos); if (currentpos !=document.body.scrollTop) sc(); } document.onmousedown=sc document.ondblclick=initialize //更改字體大小 var status0=’’; var curfontsize=10; var curline function fontZoomA(){ if(curfontsize〉8){ document.getElementById(’fontzoom’).style.fontSize=(--curfontsize) ’pt’; document.getElementById(’fontzoom’).style.lineHeight=(--curlineheight) ’pt’; } } function fontZoomB(){ if(curfontsize〈64){ document.getElementById(’fontzoom’).style.fontSize=( curfontsize) ’pt’; document.getElementById(’fontzoom’).style.lineHeight=( curlineheight) ’pt’; } } 〈/script〉 {$MY_ResumeError} 〈/head〉 |
很明顯,在這里,我針對要害字做了簡單優化,即以下部分: