既然 sss() 是与其它字符串组合的, 那么它里面就不要再用 document.write了:
function sss()
{
var str = "<input type='text' id='lsk' value='森'><input class='navPoint' type='button' value='2' ID='Butston2' NAME='Button1'>"; str += "<input type='text' id='lsk' value='123456'><input class='navPoint' type='button' value='2' ID='Butston2' NAME='Button1'>";
return str;
}
function sss()
{
var str = "<input type='text' id='lsk' value='森'><input class='navPoint' type='button' value='2' ID='Butston2' NAME='Button1'>"; str += "<input type='text' id='lsk' value='123456'><input class='navPoint' type='button' value='2' ID='Butston2' NAME='Button1'>";
return str;
}
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head><body>
ddd
<script language=javascript>
document.write("<table><tr><td>"+sss()+"</td></tr></table>");
function sss()
{
document.write("<input type='text' id='lsk' value='森'><input class='navPoint' type='button' value='2' ID='Butston2' NAME='Button1'>");// document.write("<input type='text' id='lsk' value='123456'><input class='navPoint' type='button' value='2' ID='Butston2' NAME='Button1'>");
}
</script>
</body></html>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
gb2312是大陆地编码