怎样让弹出小窗口里面显示的是我一个变量的内容? a=1000b=window.open()b.document.write(a) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 ps:写完了最好b.document.close(),否则浏览器一直下载,好多次我没有close(),连onload都触发不了!<script>nw=window.open()nw.document.write("test")//什么都能写,包括js!nw.doucment.close()</script> 这是客户端的,不牵扯php的问题,如果你会HTML嵌套php,非要用PHP写的话,就是下边的样子:<?echo "<script>";echo "nw=window.open()";echo "nw.document.write(\"test\")";echo "nw.doucment.close()";echo "</script>"?> echo "<script>alert('".$var."')</script>";are you ok? 给xinyunyishui(心云意水) :谢谢,那几行可以合并的吧?给flybird000(飞鸟000):呵呵,你的招够狠的,怎么能alarm呢?我是显示歌词呀:) xinyunyishui的意思是还可以不用php?单独在html里面用js怎么写? 我定义了一个<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]就不能跟着列表的出现循环更新了,即不显示了,因为循环中才把歌词的名字和内容赋值的。怎么办? <script language="JavaScript">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肯定有对数据库的操作,我只是写个意思给你。 原来js的function也可以带参的:) http://www.soulsky.net/music.php:( 关键是"<a href=\"javascript:winopen('$t[name]','$t[word]')\">歌词</a>"里面的'$t[name]','$t[word]'单引还是双引。 内容的格式变了!原文是这一句:$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> 求解wamp打开怎么成这样了 怎么做网站推广?搜索引擎怎么弄的? session_id经常变,页与页之间取不到值!如何解决?难啊 请问这个正则怎么理解啊,, 一个数组的转换 PHP MVC初学者问题... php安装的一些问题!谢了先! 调用函数的问题,请大家帮忙看看! 新人,怎么知道一个用户访问过该网站两次了呢 应届毕业生一枚,不熟悉编程,想了解一下 简单问题搞死我了。请问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>