L
louvino
I take html code and I want to get it without new line, tab...;
But, It doesn't work.
My code :
<HTML>
<SCRIPT language=javascript>
function transform() {
var html= document.getElementById("corps").innerHTML;
alert(html.replace("[\f\n\r\t\v]*",""))
}
</SCRIPT>
<BODY onload=transform()>
<DIV id="corps">
<P>aaaaaaaaaaaaaaaaaaaaaaaaaaaaa</P>
<P>aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
<P>aaaaaaaaaaaaaaaaaaaaaaaaaaaaa</P>
<P>
<TABLE>
<TR><TD>
<TABLE>
ppppppppppppppppppppppp
</TABLE>
<P>aaaaaaaaaaaaaaaaaaaaa</P>
</TD></TR>
</TABLE>
aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
<P>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</P>
</DIV>
</BODY>
</HTML>
But, It doesn't work.
My code :
<HTML>
<SCRIPT language=javascript>
function transform() {
var html= document.getElementById("corps").innerHTML;
alert(html.replace("[\f\n\r\t\v]*",""))
}
</SCRIPT>
<BODY onload=transform()>
<DIV id="corps">
<P>aaaaaaaaaaaaaaaaaaaaaaaaaaaaa</P>
<P>aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
<P>aaaaaaaaaaaaaaaaaaaaaaaaaaaaa</P>
<P>
<TABLE>
<TR><TD>
<TABLE>
ppppppppppppppppppppppp
</TABLE>
<P>aaaaaaaaaaaaaaaaaaaaa</P>
</TD></TR>
</TABLE>
aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
<P>aaaaaaaaaaaaaaaaaaaaaaaaaaaa</P>
</DIV>
</BODY>
</HTML>