用js实现的页面关键字密度查询代码
2007-12-27 00:00
691 查看
关键字密度查询工具我在网上找了很久,还是没找到一个合适的关键字密度查询工具,为什么呢?因为我的站是utf-8编码的,而网上提供的大部分是GB2312的。还是继续找关键字密度查询工具,结果找到一个,不过不是通过输入网址的,而是自己要把代码拷过去的。这样的关键字密度查询工具虽然用起来不是很方面,但我一时也没找到比较好的关键字密度查询工具。如果你找到了,一定要联系我。要求:只要你找的关键字密度查询工具支持UTF-8编码就可以了。
Sub ClearB_OnClick
MyWords.txt_Info.value=""
MyWords.txt_OnlyText.value=""
MyWords.txt_Info.focus()
end sub
Sub ChkB_OnClick
strKW=MyWords.MyKeyword.value
str=replace(MyWords.txt_Info.value," ","")
str=replace(str," ","")
str=replace(str,">","")
str=replace(str,"<","")
str=replace(str,chr(9),"")
str=replace(str,chr(10),"")
str=replace(str,chr(13),"")
str=replace(str,chr(34),"")
str=str&""
htmDes="",1)
MyHtmDes=mid(Str,whereHtmDesL,whereHtmDesR-whereHtmDesL)
str=MyHtmDes&str
end if
htmDes="",1)
MyHtmDes=mid(Str,whereHtmDesL,whereHtmDesR-whereHtmDesL)
str=MyHtmDes&str
end if
LenStr=len(str)
'msgbox "LenStr="&LenStr
If InStr(1, Str, "", 1)
'MsgBox "tmpStrR=" & tmpStrR
If tmpStrR = 0 Then tmpStrR = LenStr
'MsgBox "i=" & i
OnlyText = OnlyText & Mid(Str, i, tmpStrL - i)
'MsgBox Mid(Str, i, tmpStrL - i)
i = tmpStrR + 2
Else
i = i + 1
End If
Loop
Str = OnlyText
Str =Str&"", 1)
'MsgBox "tmpStrR=" & tmpStrR
If tmpStrR = 0 Then tmpStrR = LenStr
'MsgBox "i=" & i
OnlyText = OnlyText & Mid(Str, i, tmpStrL - i)
'MsgBox Mid(Str, i, tmpStrL - i)
i = tmpStrR + 1
Else
i = i + 1
End If
Loop
Str = OnlyText
LenStr=len(str)
LenKW=len(replace(strKW," ",""))
if LenStr LenStr
tmpStr=instr(i,str,strKW,1)
if tmpStr>0 then
KeywordTimes=KeywordTimes+1
i=tmpStr+1
else
i=i+1
end if
loop
strlenKW=int(KeywordTimes*LenKW*1000/LenStr+0.5)/10
fmlenKW=cstr(strlenKW)
if left(fmlenKW,1)="." then fmlenKW= "0" & fmlenKW
msgbox "有"& LenStr& "个字符,关键字出现"&KeywordTimes&"次,关键字密度为" & strlenKW & "%。" ,64,"11-1.cn 字符计算"
else
msgbox "有"& LenStr& "个字符" ,64,"LoveSEO.com字符计算"
end if
MyWords.txt_Info.focus()
end sub
..:::关键字密度查询:::..
请拷贝你的网页源文件到此
源码框
关键字
关键字密度查询结论框
Sub ClearB_OnClick
MyWords.txt_Info.value=""
MyWords.txt_OnlyText.value=""
MyWords.txt_Info.focus()
end sub
Sub ChkB_OnClick
strKW=MyWords.MyKeyword.value
str=replace(MyWords.txt_Info.value," ","")
str=replace(str," ","")
str=replace(str,">","")
str=replace(str,"<","")
str=replace(str,chr(9),"")
str=replace(str,chr(10),"")
str=replace(str,chr(13),"")
str=replace(str,chr(34),"")
str=str&""
htmDes="",1)
MyHtmDes=mid(Str,whereHtmDesL,whereHtmDesR-whereHtmDesL)
str=MyHtmDes&str
end if
htmDes="",1)
MyHtmDes=mid(Str,whereHtmDesL,whereHtmDesR-whereHtmDesL)
str=MyHtmDes&str
end if
LenStr=len(str)
'msgbox "LenStr="&LenStr
If InStr(1, Str, "", 1)
'MsgBox "tmpStrR=" & tmpStrR
If tmpStrR = 0 Then tmpStrR = LenStr
'MsgBox "i=" & i
OnlyText = OnlyText & Mid(Str, i, tmpStrL - i)
'MsgBox Mid(Str, i, tmpStrL - i)
i = tmpStrR + 2
Else
i = i + 1
End If
Loop
Str = OnlyText
Str =Str&"", 1)
'MsgBox "tmpStrR=" & tmpStrR
If tmpStrR = 0 Then tmpStrR = LenStr
'MsgBox "i=" & i
OnlyText = OnlyText & Mid(Str, i, tmpStrL - i)
'MsgBox Mid(Str, i, tmpStrL - i)
i = tmpStrR + 1
Else
i = i + 1
End If
Loop
Str = OnlyText
LenStr=len(str)
LenKW=len(replace(strKW," ",""))
if LenStr LenStr
tmpStr=instr(i,str,strKW,1)
if tmpStr>0 then
KeywordTimes=KeywordTimes+1
i=tmpStr+1
else
i=i+1
end if
loop
strlenKW=int(KeywordTimes*LenKW*1000/LenStr+0.5)/10
fmlenKW=cstr(strlenKW)
if left(fmlenKW,1)="." then fmlenKW= "0" & fmlenKW
msgbox "有"& LenStr& "个字符,关键字出现"&KeywordTimes&"次,关键字密度为" & strlenKW & "%。" ,64,"11-1.cn 字符计算"
else
msgbox "有"& LenStr& "个字符" ,64,"LoveSEO.com字符计算"
end if
MyWords.txt_Info.focus()
end sub
..:::关键字密度查询:::..
请拷贝你的网页源文件到此
源码框
关键字
关键字密度查询结论框
相关文章推荐
- 用js实现的页面关键字密度查询代码
- 通过WebView向html页面注入js代码,实现WebView切换白昼模式/夜间模式
- js实现类似MSN提示的页面效果代码分享
- JS当前属性查询实现代码
- js代码:实现主页面滚动条随iframe里的内容自动调整
- html+css+angularjs 实现商品库存信息管理页面 可删除/批量删除/可模糊查询/可升序降序
- js实现页面转发功能示例代码
- js实现页面打印功能实例代码(附去页眉页脚功能代码)
- JS实现页面内跳转的简单代码
- html+css+angularjs 实现商品库存信息管理页面 可删除/批量删除/可模糊查询/可升序降序
- JS代码实现根据时间变换页面背景效果
- 在iframe里的页面编写js,实现在父窗口上创建动画效果展开和收缩的div(不变动iframe父窗口代码)
- 始终在页面底部的层js实现代码
- 利用JS自动打开页面上链接的实现代码
- 在C#代码(后台aspx.cs)页面中实现js的alert功能
- js实现页面查询弹出div隐藏背景提示进度
- JS当前属性查询实现代码
- js统计页面的来访次数实现代码
- js setInterval 代码实现页面轮询