1
我有一個假的訪問者的計數器腳本,其中的JavaScript代碼,但我想在smarty tpl文件中使用它,我嘗試去做,但沒有顯示我想要的位置。腳本代碼低於如何在smarty tpl中使用javascript功能
<!--Simply copy and paste it where you wish the counter to appear.-->
<SCRIPT language="JavaScript" type="text/javascript">
// counter - from http://rainbow.arch.scriptmania.com/scripts
function fakecounter(){
//decrease/increase counter value (depending on perceived popularity of your site!)
var decrease_increase=2460
var counterdate=new Date()
var currenthits=counterdate.getTime().toString()
currenthits=parseInt(currenthits.substring(2,currenthits.length-4))+decrease_increase
document.write("You are visitor # <b>"+currenthits+"</b> to my site!")
}
fakecounter()
</script>
我試圖在</script>
之後使用它。