<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>潘锦的空间 &#187; window.open参数</title>
	<atom:link href="https://www.phppan.com/tag/window-open%e5%8f%82%e6%95%b0/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.phppan.com</link>
	<description>SaaS SaaS架构 团队管理 技术管理 技术架构 PHP 内核 扩展 项目管理</description>
	<lastBuildDate>Sat, 25 Apr 2026 00:56:17 +0000</lastBuildDate>
	<language>zh-CN</language>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=3.9.40</generator>
	<item>
		<title>window.open窗口名称的问题</title>
		<link>https://www.phppan.com/2009/09/window-open-name-question/</link>
		<comments>https://www.phppan.com/2009/09/window-open-name-question/#comments</comments>
		<pubDate>Sun, 20 Sep 2009 01:32:33 +0000</pubDate>
		<dc:creator><![CDATA[admin]]></dc:creator>
				<category><![CDATA[程序相关]]></category>
		<category><![CDATA[JAVASCRIPT]]></category>
		<category><![CDATA[window.open参数]]></category>
		<category><![CDATA[window.open窗口名称]]></category>
		<category><![CDATA[新窗口打开]]></category>

		<guid isPermaLink="false">http://www.phppan.com/?p=231</guid>
		<description><![CDATA[今日在一页面中需要点击查询按钮据下拉选择弹出不同的统计结果页面。即使用如下代码： 【代码一】 1 2 3 4  [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>今日在一页面中需要点击查询按钮据下拉选择弹出不同的统计结果页面。即使用如下代码：</p>
<p>【代码一】</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;script type=&quot;text/javascript&quot;&gt;
window.open (url, ‘newwindow’, 'height=600, width=800, top=0, left=0, toolbar=no, menubar=no, 
scrollbars=yes, resizable=yes,location=no, status=no');
&lt;/script&gt;</pre></td></tr></table></div>

<p>当多次点击按钮触发此事件时，无法选择哪种统计方式，显示的结果总是在一个页面打开，除非关闭这个页面才会重新打开页面。不懂，于是修改其各个参数。终于在改变了newwindow后才出现所要的效果（对于每种类别在不同的窗口中显示）。<br />
【所得】</p>
<p>Window.open的第二个参数是用来标记当前页面的子窗口的，可以存在多个标记为空’’的子窗口，但是对于一个不为空的标记，只能存在一个此标记的窗口。如【代码一】所示，此代码在一个页面，即使是多次触发，也只会打开一个页面，就算是其它参数不同。<br />
【简单示例】</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;script type=&quot;text/javascript&quot;&gt;
   var url = &quot;index.html&quot;;
   window.open (url, 'name', 'height=600, width=800, top=0, left=0, toolbar=no, menubar=no, 
scrollbars=yes, resizable=yes,location=no, status=no');
&lt;/script&gt;</pre></td></tr></table></div>

<p>附 参数详解【google所得】</p>
<p>【参数描述】</p>
<table border="0">
<tbody>
<tr>
<td>参数名</td>
<td>参数说明</td>
</tr>
<tr>
<td>url</td>
<td>弹出窗口的文件名</td>
</tr>
<tr>
<td>name</td>
<td>弹出窗口的名字（不是文件名），非必须，可用空&#8221;代替</td>
</tr>
<tr>
<td>height</td>
<td>窗口高度</td>
</tr>
<tr>
<td>width</td>
<td>窗口宽度</td>
</tr>
<tr>
<td>top</td>
<td>窗口距离屏幕上方的象素值</td>
</tr>
<tr>
<td>left</td>
<td>窗口距离屏幕左侧的象素值</td>
</tr>
<tr>
<td>toolbar</td>
<td>是否显示工具栏，yes为显示</td>
</tr>
<tr>
<td>menubar，scrollbars</td>
<td>表示菜单栏和滚动栏</td>
</tr>
<tr>
<td>resizable</td>
<td>是否允许改变窗口大小，yes为允许</td>
</tr>
<tr>
<td>location</td>
<td>是否显示地址栏，yes为允许</td>
</tr>
<tr>
<td>status</td>
<td>是否显示状态栏内的信息（通常是文件已经打开），yes为允许</td>
</tr>
</tbody>
</table>
]]></content:encoded>
			<wfw:commentRss>https://www.phppan.com/2009/09/window-open-name-question/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
