JavaScript with frame

xiaoxiao2021-03-06  73

Episode

There have been many questions that I have a problem with the JavaScript and the frame (for the sake of seeking, with a FRAME table below). Really, if you want to use Frames and JavaScript's functionality, you must have a Netscape Navigator 2.0 (or above) browser (for less than a small purpose). Of course, some browser supports Frames' function - such as: Oracle's PowerBrowser, but this browser is just a beta version, and it is not supported by JavaScript. First, I will explain it to the function of Frames. Due to the Frames function, there is still a lot of HTML files in many html documents. Frames The most power is "divided" your window, so that each "small window" (Frame "can display different HTM L files (translated by: This is a point-like electrician master picture). What is more wonderful is that there is no interaction between Frame, that is, it is said that it can exchange information and information between Frames. For example, if you set up two frames, the first Frame can display General HTML documents, and the second frame can display toolbar. This integration column can be packaged in the various buttons you need to view your HomePage. As this, the first Frame has contained another HTML file, and you can still see the tool column in the second frame. Now I will show you the above characteristics first. Please press the button below to see the long phase of Frames. (If you are online viewing this file, you can need to see the results, because Scripts must be loaded into your machine by Server).

Below is this Frame Writing:

frames </ title></p> <p></ HEAD></p> <p><Frameset Rows = "50%, 50%"></p> <p><Frame src = "frTest1.html" Name = "fr1"></p> <p><Frame src = "fRTEST2.HTML" Name = "fr2"></p> <p></ Frameset></p> <p></ Html></p> <p>First, you must tell the viewer you want to open a few frames? This is the <frameset ...> This label (TAG) is declared. Rows This parameter is to tell the browser to split the window into several columns? And the number of cols tells the browser to split the window into a few lines? You can also use a lot of group <frameset ...> Tags divide the window more complicated. Under the case mentioned by NetsAcpe: <frameset cols = "50%, 50%"></p> <p><Frameset Rows = "50%, 50%"></p> <p><Frame src = "cell.html"> <frame src = "cell.html"></p> <p></ Frameset></p> <p><Frameset Rows = "33%, 33%, 33%"></p> <p><Frame src = "cell.html"></p> <p><Frame src = "cell.html"></p> <p><Frame src = "cell.html"></p> <p></ Frameset></p> <p></ Frameset></p> <p>This example of this example has born two lines, and the second line is divided into three columns of space. 50% in the first <frameset> TAG, 50% of the two numbers are the size of the Frame. You can give each Frame a "name" (Name). Frame's name is not often important in the JavaScript language. In the first parameters of this chapter, you have learned what to name it. Next to you can use the <frame> tag tell your browser which HTML file you want to load.</p> <p>I think you have already solved the basic usage of frames, and then come to us to see a fun example:</p> <p>The upper button will be displayed: After pressing the button in a frame, the text will be written in another Frame. Under the original code of this function: Before you have a Frames effect, you need to make the following original code (Frames.html): <HTML></p> <p><HEAD></p> <p><title> frames </ title></p> <p></ HEAD></p> <p><Frameset Rows = "50%, 50%"></p> <p><Frame src = "frame1.html" name = "fr1" NORSIZE></p> <p><Frame src = "frame2.html" name = "fr2"></p> <p></ Frameset></p> <p></ Html></p> <p>Below is the original code of frame1.html: <HTML></p> <p><HEAD></p> <p><script language = "javascript"></p> <p><! - HIDING</p> <p>Function hi () {</p> <p>Document.write ("Hey! <br>");</p> <p>}</p> <p>Function YO () {</p> <p>Document.write ("! <br>");</p> <p>}</p> <p>Function Bla () {</p> <p>Document.write ("La La <BR>");</p> <p>}</p> <p>// -></p> <p></ script></p> <p></ HEAD></p> <p><Body></p> <p>This is the first Frame!</p> <p></ Body></p> <p></ Html></p> <p>Below is the original code of frame2.html: <html></p> <p><body></p> <p>This is the second Frame!</p> <p><p></p> <p><Form name = "buttonbar"></p> <p><Input Type = "Button" Value = "" onclick = "Parent.fr1.hi ()"> <input type = "" value = "" onclick = "parent.fr1.yo ()"></p> <p><Input Type = "Button" Value = "=" onclick = "Parent.fr1.bla ()"></p> <p></ Form></p> <p></ Body></p> <p></ Html></p> <p>Wow! These syntax is getting more and more! How is the above grammar work? When the user loaded into the first file (Frames.html), two frame will be generated, and in the first frame (name Frame1.html is loaded in 'fr1'), and Frame2.html is loaded in the second frame (named 'fr2'). It is only a general HTML language method before it is. Or you have already issued a JavaScript language in Frame1.html, but this JavaScript has not been executed. It is difficult to get to these letters (functions) or I have to delete these unwanted letters? Although I am a person who is used, these letters are really necessary. They are screaming in the JavaScript language in Frame2.html. I used the Java Script language to make three buttons in frame2.html, and I have been mentioned in the first chapter. I believe that you have been familiar with the Law of OnClick. But it is ... Parent.FR1 is it? If you have a solution to the object of item, I believe that it is not very new to you. You can see two files of frame1.html with frame2.html when frames.html, which is called Frames.html, called Frames.html and Frame2.html Parent (I will use English). The two new Frames are called Frames.html Child- Frames. You can imitate this complex clutch to hierarchy. I will help a small 'map' to chercipize this system: frames.html parent</p> <p>/ /</p> <p>/ /</p> <p>/ /</p> <p>FR1 (frame1.html) FR2 (frame2.html) Children</p> <p>Of course, you can use this class to generate some 'GrandChildren' Frames. (When this is not a formal name): frames.html Parent</p> <p>/ /</p> <p>/ /</p> <p>/ /</p> <p>FR1 (frame1.html) FR2 (frame2.html) Children</p> <p>/ /</p> <p>/ /</p> <p>/ /</p> <p>GChild1 Gchild2 'Grandchildren'</p> <p>If you want to call any of the Frame2.html call Parent-frame, you just put the Parent before you call the function name. HOTICS, if you are located in Frame1.html, you only need to put Fr1 before the called function name. What is FR1? The original because I have opened two frames in Frames.html, and they are divided into FR1 and FR2. I used FR1 to represent the first frame (frame1.html). The next step is to be easy. What should we do when we want to call the first frame2.html (named FR2)? You can find that Frame1.html and Frame2.html are not directly connected between Frame1.html and Frame2.html. (CONNECTION), so you may not "direct" by the Frame2.html call in Frame1.html. You must call it through the Parent- Frame, and the correct indicator (index) should be Parent.fr1. For example, if you want to call Hi by Frame2.html, you must write to parent.fr1.hi (). That is why is the original because of the onclick in Frame2.html to write into the prototype. By the way! Attached to the small West. You or a license has been published in this chapter. It doesn't seem to be different between the two. But when JavaScript is implanted into the Netscape browser, you can only use the livescript. (This is an old understanding of Netscape, and JavaScript is extremely similar). I don't think I discuss the JavaScript lettering, you should use the JavaScript language. (This is just my own opinion, there are many concerns about Livescript in 'JavaScript- Society', and the current is also the public.)</p> <p>Here I have to spend a time to discuss a lot of people concerned. When you view a web page with several frame, if you want to link to the Internet, these Frames will not lose and band-visual interference. Why do you have to remove these troubles? You just have to add Target = "_ TOP" in your <a href..> tag. The method is as follows: <a href="goaway.html" target="_top"> If you don't want to watch my webpage </a> is of course, you must join Target = "_ TOP ". If you want to have this effect through LINK in the entire network page, you can add <base target = "_ TOP" in the head of this page. If this one of the LINK can be eliminated after pressing it. Back to the main directory</p> <p>Original update: 18.March'97 © 1996 by Stefan Koch Translation: May 16, 1996 © 1996 from Duan Xi Ting Translation</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-108661.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="108661" 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.049</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 = 'hUlvaLSgdOi2xa56mOA_2BM7O3eqkjfHEWPbMR4nMp2HT8FAKw3TNsfxX8t6MnJxDrOTRkKx5z4NHy4z2E'; 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>