I have some code that I would like to hide and keep people from doing a "file- save as" and running this web application on their client. I am a newbie so I'm just learning. I already have a server with php, cgi, etc..
My code basically converts any spaces, returns, tabs ect. to ',' and counts them.
Any ideas would be appreciated.
tav
My code basically converts any spaces, returns, tabs ect. to ',' and counts them.
Any ideas would be appreciated.
Code:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function convertSpaces(str)
{
str=str.replace(/\r/g,"")
str=str.replace(/\s/g,",")
str=str.replace(/\,,*/g,",")
str=str.replace(/\''*/g,"")
str=str.replace(/(,*),$/,"$1")
str=str.replace(/(,*),$/,"$1")
str=str.replace(/(,*),$/,"$1")
str=str.replace(/(,*),$/,"$1")
str=str.replace(/(,*),$/,"$1")
str=str.replace(/(,*),$/,"$1")
str=str.replace(/(,*),$/,"$1")
str=str.replace(/\,,*/g,"','")
str=str.replace(/^','/g,"")
return str;
}
// End -->
</script>
<!-- END CONVERT SPACES -->
<!-- BEGIN TEXT AREA 1 -->
<textarea name="user" rows="10" cols="35" onBlur="this.value
=
convertSpaces(this.value);countWords(this.value);"></textare
a>
<!-- END TEXT AREA 1 -->
<!-- COUNT RECORDS -->
<SCRIPT language=javascript type=text/javascript>
function countWords(strVal){
var strArray = strVal.split ("','");
document.getElementById('cnt').innerHTML =
strArray.length;
}
</SCRIPT>
<div align="center">
Record count is <SPAN id=cnt>0</SPAN></div>
<!-- END COUNT RECORDS -->