sun_rise
10-11-2007, 05:23 AM
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script language="javascript">
function modifyNullToBlank(temp)
{
if(trim(temp) == 'null')
{
temp='';
}
document.writeln(temp);
}
function removeSpaces(string) {
alert(string);
var tstring = "";
string = '' + string;
splitstring = string.split(" ");
for(i = 0; i < splitstring.length; i++)
tstring += splitstring[i];
return tstring;
}
</script>
</HEAD>
<BODY>
<textarea>
<script language="javascript">
modifyNullToBlank(removeSpaces('null'));
</script>
</textarea>
</BODY>
</HTML>
when i run this code, i get the full javascript code in the textarea !!
I am expecting blank in fact.
anything wrong in my function ?
any syntax error ?
I dont want to change this structure in fact.
THIS IS a GENERATED CODE in my system.
I want to give a fix to this existing code.
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<script language="javascript">
function modifyNullToBlank(temp)
{
if(trim(temp) == 'null')
{
temp='';
}
document.writeln(temp);
}
function removeSpaces(string) {
alert(string);
var tstring = "";
string = '' + string;
splitstring = string.split(" ");
for(i = 0; i < splitstring.length; i++)
tstring += splitstring[i];
return tstring;
}
</script>
</HEAD>
<BODY>
<textarea>
<script language="javascript">
modifyNullToBlank(removeSpaces('null'));
</script>
</textarea>
</BODY>
</HTML>
when i run this code, i get the full javascript code in the textarea !!
I am expecting blank in fact.
anything wrong in my function ?
any syntax error ?
I dont want to change this structure in fact.
THIS IS a GENERATED CODE in my system.
I want to give a fix to this existing code.