function ceshi(num){
var content=document.myform.content.value;
switch (num) {
case 1:
var huoqv=document.myform.FindListCode0.value;
case 2:
var huoqv=document.myform.FindListCode1.value;
}if (huoqv="") {
alert("测试无效!代码为空!")
}
if (instr(content,huoqv) = 0 ){
alert("测试无效!网页没有这些代码。")
}
else if ( instr(mid(content,instr(content,huoqv)+lenb(huoqv),lenb(content)),huoqv) = 0 )
{
alert("测试成功!代码在页面是唯一的。")
}
else
{
alert("测试失败!代码有重复,开始或结束至少有一处代码是唯一才有效!")
}
}
从instr那里就不对了,是不是js里没有这个函数,该用什么函数来写,谢谢
if(content.indexOf("is")!=-1){
alert("存在is");
}else{
alert("不存在");
}