a=1000
b=window.open()
b.document.write(a)
b=window.open()
b.document.write(a)
解决方案 »
- 正则表达式高级应用,如何处理Wiki格式的字符串?
- 静态页面无刷新评论,急
- mysql 大于等于号无效 郁闷。怪事了。
- 初学php,有点问题想请教,关于类对象的参数使用
- 寻求PHP高手合作
- [给初学者的原创教程]Winodws下IIS/Apache+PHP+MySQL的安装配置
- imap_setflag_full函数使用求解
- 为什么php在win和linux下对于相对路径的解释不一致?
- <? php_track_vars?> 是何意思?
- lilo问题,安装完redHat7.1后,windows无法启动
- 简单问题搞死我了。请问PHP中如何返回昨天的日期。
- 关于正则表达式的问题("(\{)(\r\n)*(.*)(\})"),精通者请进
nw=window.open()
nw.document.write("test")//什么都能写,包括js!
nw.doucment.close()
</script>
<?
echo "<script>";
echo "nw=window.open()";
echo "nw.document.write(\"test\")";
echo "nw.doucment.close()";
echo "</script>"
?>
are you ok?
给flybird000(飞鸟000):呵呵,你的招够狠的,怎么能alarm呢?我是显示歌词呀:)
<script language="JavaScript">
function WinOpen() {
msg=window.open("","DisplayWindow","toolbar=no,scrollbars=yes,resizable=yes,menubar=no,location=no,top=0,left=0,width=350,height=300");
msg.document.write("<HEAD><TITLE><?=$t[name]?>的歌词</TITLE></HEAD>");
msg.document.write("<table><tr><td><?=$t[word]?></td></tr></table>");
msg.document.close();
}
</script>
但是把它放在循环里面,用<a href=\"javascript:onclick=WinOpen()\">歌词</a>显示歌词却显示错误,只能把定义放在循环外面。但是这样的话$t[name]就不能跟着列表的出现循环更新了,即不显示了,因为循环中才把歌词的名字和内容赋值的。怎么办?
function WinOpen(tit,word) {
msg=window.open("","DisplayWindow","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></HEAD>");
msg.document.write("<table><tr><td>"+word+"</td></tr></table>");
msg.document.close();
}
</script>
<?for(i=0;i<5;i++)
echo "<a href=\"javascript:winopen('$t[name]','$t[word]')\">歌词</a>"
?>我知道你for肯定有对数据库的操作,我只是写个意思给你。
:(
$table.= "<td height=20> <a href=\"javascript:onclick=WinOpen('$t[name]','$t[word]')\"><font color=#CC66CC>歌词</font></a>";
是不是这样不行?附:<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();
}
</script>