<script language="JavaScript">
function WinOpen(tit,sword) {
  msg=window.open("","","toolbar=no,scrollbars=yes,resizable=yes,menubar=no,location=no,top=0,left=0,width=350,height=300");
  msg.document.write("<HEAD><TITLE>"+tit+"的歌词</TITLE><LINK href='http://www.soulsky.net/style.css' rel=stylesheet type=text/css></HEAD>");
  msg.document.write("<table><tr><td>"+sword+"</td></tr></table>");
  msg.document.close();
}
WinOpen('tit','sword')
</script>
需要注意的是2点:必须转义和把回车变成空格

解决方案 »

  1.   

    例子:
    <script>
    _new=window.open('','','scrollbars=1,toolbar=0,resizable=1,width=400,height=320');
    _new.document.open();
    _new.document.write("<body topmargin='0' leftmargin='0' bgcolor='#FEFFE7' style='font-size:9pt'><table border='0' cellpadding='0' cellspacing='0' width='100%' align='center' background='/images/bgtl.gif'><tr><td><img src='/images/tl.jpg' hspace='3'></td><td width='100%' align='center'><b style='color:#ffffff;font-size:11pt'>热烈祝贺十届全国人大一次会议胜利闭幕&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</b></td></tr></table>")
    _new.document.write("<div style='padding:5px;'>");
    _new.document.write("<IMG style=\"WIDTH: 394px; HEIGHT: 287px\" height=207 src=\"/UploadImages/2003-3/20033103940502.jpg\" width=331 border=0>");
    _new.document.write("</div><div align=center style='padding:5px'><input type=button value='关闭窗口' onclick='window.close()'></center>");
    _new.document.close();
    _new.document.title="热烈祝贺十届全国人大一次会议胜利闭幕";
    </script>
      

  2.   

    <a href=\"javascript:onclick=WinOpen('$t[name]','$t[word]')\">歌词a>"
    这样引用为何不行?