JavaScript Window Function Guide Name Window and Frame

zhaozj2021-02-08  223

JavaScript Window Function Guide Name Window and Frame

(Author: hear the wind compiler 2001 at 11:35 on January 19)

When you create a document of a framework structure, the Name property of the tag defines the name of each frame, as follows: In the example, the document contains 2 frames: LEFT and RIGHT. In the document Toolbar.html, the link code is like the following: About us Feedback Note,

tag also supports the target property, which defines the target window in response to the form. The tag indicates all the universal default target windows of all links in the document: The tag on the above defines the target location of all elements in the page. The following HTML elements support Target properties: , , . In practical applications, the element must appear between the Head tag of the document, before any elements that point to the external resource. If the tag is specified in the document, the link will no longer follow the default target position, but it is clearly pointed to another different Target location: table of contents About US Feedback As seen above, the first link TARGET is "_self" (with a downline), which means that the new document opens in the currently active window when you click this link. The following table lists some special Target location identifiers in HTML:

Target Meaning_BLANK is loaded in a new empty window, and the new window is not named. _PARENT is loaded in the direct parent window of the window where the link is located. _Search is loaded on the browser search area, note that this feature is only available in Internet Explorer 5 or later. _Self loads documents in the window where the link is located. _Top loads a document in the top window. Now we understand the frame name, below them work with the window. When defining the Target is "_blank", a new window will pop up. For example, if you want a link to open in a new window, use the following code: a new page New window is not named, in other words, it can't Quoted by the Target property of other elements. But what happens when we use a standard Target name? Please see the definition below: a new tip In this case, we provide a special name for the new window. The name of the new window is "tip", so any link or form is defined as long as Target = "TIP" is defined, the page is loaded in the same window. If there is no frame or window to match the specified target, then click the link to open in a new window. Take a look at the example below: ccidnet Technical heavens and earth to see the result: ccidnet, technology world

Click on the first link to open the document in a new window. Click on the second link and will also generate a new window. If you click on the link again, the new window will still open. If you see, the link will have a new window every time you are clicked. Let's try again below: ccidnet Technical heavens and earth effects are as follows: CCIDNET,

Technical world

Click on the first link to generate a new window. Then click on the second link, the new document will appear in the window just opened. The new window defines a clear name called "main", so any link or form specified Target = "main" will be loaded in that window. The name of the name is by the help of JavaScript, we can discover the name of the window through the window's name attribute (for IE3 , N2 ). Similarly, we can set the name attribute of a frame or window (for IE3 , N3 ). Let's take a look at the HTML document below: Display name </ title> </ head> <body> <script language = "javascript"> <! - alert (' The name of this window is: " window.name '"); // -> </ script> </ body> </ html> Take a look at the link below: <a href = "showname. HTML "target =" _ blank "> a new window </a> <a href="showname.html" target="first"> first window </a> <a href =" showname.html "target =" second " > Second window </a> <a href="showname.html "target="third"> third window </A> Document showname.html contains a scriptor, it is responsible for displaying the name of the window in an Alert dialog . The Name property belongs to the Window object. It can be used by any Window object, including a frame. For example, the following statement sets the name of a frame window: parent.frames [1] .name = "right"; When the framework is operated, it is very simple to access the different layers. If you want to see more details, please visit Window References. HTML cannot assign a name to the current window. That is, in the current page, it is impossible to set the name of the current window via HTML code. To achieve this, there is only one way to assign a value for the Window.Name property. Let's try it out, see the following code, it created a simple button, click on the name of the current window: <form> <input type = "" value = "set name to mywin" onclick = "Window. Name = 'mywin' "> </ form> After clicking the button, the name of the current window will change to" mywin "unless other values ​​are assigned, it will remain.</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-3456.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="3456" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.052</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = 'NWzhBtLFg_2FRocMHoYy0pQA49qudcS0Fm5JpLvRL_2FnsYz6FjjyCKNQlfNHlNyyS_2FABq5o0Re5UFerkBlN'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>