
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
	<head><meta forua="true" http-equiv="Cache-Control" content="max-age=0" /></head><card id="MainCard" title="&#x6B22;&#x8FCE;&#x5149;&#x4E34;"><p><a href="wap.asp">&#x6728;&#x5B50;&#x5C4B;</a><br/>&nbsp;</p><p><b>&#x6807;&#x9898;&#x3A;</b> &#x4F;&#x70;&#x65;&#x6E;&#x69;&#x6E;&#x67;&#x20;&#x61;&#x20;&#x4E;&#x65;&#x77;&#x20;&#x57;&#x69;&#x6E;&#x64;&#x6F;&#x77;</p><p><b>&#x4F5C;&#x8005;&#x3A;</b> &#x61;&#x64;&#x6D;&#x69;&#x6E;</p><p><b>&#x65E5;&#x671F;&#x3A;</b> &#x32;&#x30;&#x30;&#x36;&#x2D;&#x30;&#x39;&#x2D;&#x32;&#x31;&#x20;&#x30;&#x39;&#x3A;&#x35;&#x34;&#x20;&#x41;&#x4D;</p><p><b>&#x5206;&#x7C7B;&#x3A;</b> <a href="wap.asp?do=showLog&amp;cateID=4">&#x811A;&#x672C;&#x8BED;&#x8A00;</a></p><p><b>&#x5185;&#x5BB9;&#x3A;</b> To open a new window, you will need to use yet another ready-made JavaScript function. Here is what it looks like: <br/>window.open(&#39;url to open&#39;,&#39;window name&#39;,&#39;attribute1,attribute2&#39;) <br/>This is the function that allows you to open a new browser window for the viewer to use. Note that all the names and attributes are separated with a comma rather than spaces. Here is what all the stuff inside is: <br/>1.&#39;url to open&#39;<br/>This is the web address of the page you wish to appear in the new window. <br/>2.&#39;window name&#39;<br/>You can name your window whatever you like, in case you need to make a reference to the window later. <br/>3.&#39;attribute1,attribute2&#39;<br/>As with alot of other things, you have a choice of attributes you can adjust. <br/>Window Attributes <br/>Below is a list of the attributes you can use: <br/>1.width=300<br/>Use this to define the width of the new window. <br/>2.height=200<br/>Use this to define the height of the new window. <br/>3.resizable=yes o&#114; no<br/>Use this to control whether o&#114; not you want the user to be able to resize the window. <br/>4.scrollbars=yes o&#114; no<br/>This lets you decide whether o&#114; not to have scrollbars on the window. <br/>5.toolbar=yes o&#114; no<br/>Whether o&#114; not the new window should have the browser navigation bar at the top (The back, foward, stop buttons..etc.). <br/>6.location=yes o&#114; no<br/>Whether o&#114; not you wish to show the location box with the current url (The place to type http://address). <br/>7.directories=yes o&#114; no<br/>Whether o&#114; not the window should show the extra buttons. (what&#39;s cool, personal buttons, etc...). <br/>8.status=yes o&#114; no<br/>Whether o&#114; not to show the window status bar at the bottom of the window. <br/>9.menubar=yes o&#114; no<br/>Whether o&#114; not to show the menus at the top of the window (File, Edit, etc...). <br/>10.copyhistory=yes o&#114; no<br/>Whether o&#114; not to copy the old browser window&#39;s history list to the new window. <br/>All right, here&#39;s an example code for opening a new window: <br/>&lt;FORM&gt; <br/>&lt;INPUT type=&#34;button&#34; value=&#34;New Window!&#34; onClick=&#34;window.open(&#39;http://www.pageresource.com/jscri&#112;t/jex5.htm&#39;,&#39;mywindow&#39;,&#39;width=400,height=200&#39;)&#34;&gt; <br/>&lt;/FORM&gt; <br/>Some Important Rules  <br/>Before we move on, we need to make note of some things so you won&#39;t go insane like I did trying to get this to work right! <br/>1.When you get to the INPUT tag, keep everything in that tag on one single line in your text editor, including the javascript commands. (The text goes to the next line on this page so you can print it out easily). <br/>2.Once you come to the onClick=&#34; &#34;, don&#39;t leave any spaces between anything. Just use the commas and the quote marks. Any white space will keep it from working correctly in Netscape. <br/>3.Don&#39;t put quote marks around the yes, no, o&#114; numbers for the attributes. You only use single quotes around the entire set of attributes. <br/>4.In some browsers, you may need to substitute the number 1 for yes, and the number zero for no in the attributes section. The yes o&#114; no should work fine, though. <br/>A New Browser Window  <br/>Okay, enough rules. Let&#39;s look at the code that makes a completely new browser! Basically, you just use yes for all of the attributes. Here is the code: <br/>&lt;FORM&gt; <br/>&lt;INPUT type=&#34;button&#34; value=&#34;New Window!&#34; onClick=&#34;window.open(&#39;http://www.pageresource.com/jscri&#112;t/jex5.htm&#39;,&#39;mywindow&#39;,&#39;width=400,height=200,toolbar=yes, <br/>location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhistory=yes, <br/>resizable=yes&#39;)&#34;&gt; <br/>&lt;/FORM&gt; <br/>Remember, keep everything on one line....one really, really long line! I just put the sample code on new lines so you wouldn&#39;t have to scroll forever to read everything........and your printer won&#39;t go crazy now either! <br/>Closing a New Window  <br/>Hmm.....what&#39;s with the &#34;Close Window&#34; button you saw in the new window? How does one do do that? To use that trick, use the window.close() function in the HTML of the new window. Just put this code wh&#101;rever you want the close button to show up in the new window: <br/>&lt;FORM&gt; <br/>&lt;INPUT type=&#34;button&#34; value=&#34;Close Window&#34; onClick=&#34;window.close()&#34;&gt; <br/>&lt;/FORM&gt; <br/>Of course, the window can be closed with the &#34;x&#34; symbol on the top-right of the window as well. <br/>Set the Window Position  <br/>There is another set of options you can use to set the position of the new window on the viewers, but it only works with NS4+ and IE4+: <br/>1.screenX=number in pixels<br/>Sets the position of the window in pixels from the left of the screen in Netscape 4+. <br/>2.screenY=number in pixels<br/>Sets the position of the window in pixels from the top of the screen in Netscape 4+. <br/>3.left=number in pixels<br/>Sets the position of the window in pixels from the left of the screen in IE 4+. <br/>4.top=number in pixels<br/>Sets the position of the window in pixels from the top of the screen in IE 4+. <br/>Great, but how do you decide which commands to use if there are different ones for each browser? In this case, you can use both sets of commands- the browser will ignore the set it does not recognize. The example below will give you a new window 0 pixels from the left and 100 pixels from the top of your screen: <br/>&lt;FORM&gt;<br/>&lt;INPUT type=&#34;button&#34; value=&#34;New Window!&#34; onClick=&#34;window.open(&#39;jex5.htm&#39;,&#39;mywindow&#39;,&#39;width=400,height=200,left=0,top=100,screenX=0,screenY=100&#39;)&#34;&gt; <br/>&lt;/FORM&gt;&nbsp;&nbsp;<br/>Now, that is a lot of work- but you can now customize a new window for your viewers!</p><p> + <a href="#CommentCard">&#x67E5;&#x770B;&#x5F53;&#x524D;&#x65E5;&#x5FD7;&#x8BC4;&#x8BBA;</a> (0)</p><p>&nbsp;<br/><br/><a href="wap.asp?do=Login">&#x767B;&#x5F55;</a></p><p><br/>&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;</p><p><a href="wap.asp">&#x6728;&#x5B50;&#x5C4B;</a></p><p><a href="http://www.pjhome.net/wap.asp">PJBlog3&nbsp;v3.2.9.518</a>&nbsp;Inside.</p><p>Processed&nbsp;In&nbsp;0.078&nbsp;ms</p><do type="prev" label="&#x8FD4;&#x56DE;"><prev/></do></card><card id="postCommentCard"><p><b>&#x6807;&#x9898;&#x3A;</b> <a href="#MainCard">&#x4F;&#x70;&#x65;&#x6E;&#x69;&#x6E;&#x67;&#x20;&#x61;&#x20;&#x4E;&#x65;&#x77;&#x20;&#x57;&#x69;&#x6E;&#x64;&#x6F;&#x77;</a></p><p><br/>你没有权限发表评论</p><p><br/>&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;</p><p><a href="wap.asp">&#x6728;&#x5B50;&#x5C4B;</a></p><p><a href="http://www.pjhome.net/wap.asp">PJBlog3&nbsp;v3.2.9.518</a>&nbsp;Inside.</p><p>Processed&nbsp;In&nbsp;0.078&nbsp;ms</p><do type="prev" label="&#x8FD4;&#x56DE;"><prev/></do></card><card id="CommentCard"><p>&#x6682;&#x65E0;&#x8BC4;&#x8BBA;</p><p><a href="#MainCard">&#x8FD4;&#x56DE;</a></p><p><br/>&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;&#x2500;</p><p><a href="wap.asp">&#x6728;&#x5B50;&#x5C4B;</a></p><p><a href="http://www.pjhome.net/wap.asp">PJBlog3&nbsp;v3.2.9.518</a>&nbsp;Inside.</p><p>Processed&nbsp;In&nbsp;0.078&nbsp;ms</p><do type="prev" label="&#x8FD4;&#x56DE;"><prev/></do></card>
</wml>
