[問題] 關鍵字密度code消失
我目前在研究這個網站 https://www.live-keyword-analysis.com/ 的code
其中有一些問題想請各位高手解答
在funjay.js這檔案裡
Q1:
if (index >= 0)
{
pindex = bodyl.indexOf(">",index);
bodyank=bodyl.substring(index,pindex+1);
bodyl=bodyl.replace(bodyank," ");
}
最後一行為什麼要replace空白字元
Q2:
bodyl=rm_ext_char.split(" ");
rm_s_d="";
full_text="";
count=0
for(i=0; i<bodyl.length; i++){
rm_s_d=bodyl[i];
if (rm_s_d.length>2){
count=count+1;
full_text=full_text+" "+rm_s_d;
}
}
最後一行+rm_s_d的目的是什麼
Q3:
while(countkf>=0){
if (countkf>=0.1 && countkf<0.2)
{
countkf = full_text.indexOf(kf,0);
}
else
{
end=countkf+kf.length;
countkf = full_text.indexOf(kf,end);
}
if (countkf >= 0)
{
kftotal=kftotal+1;
}
}
if (kslen.length>count)
document.frm1.r1.value=0;
else
document.frm1.r1.value=math_round(kftotal/(count+1-kslen.length)*100,1);
這段判斷條件為什麼要這樣去設定,看不懂他的邏輯
感謝~~
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 114.36.123.88
※ 文章網址: https://www.ptt.cc/bbs/Web_Design/M.1539924205.A.79D.html
→
10/19 13:04, , 1F
10/19 13:04, 1F