JavaScript - Reworking Old Script Self.document.forms[f].elements[i].value
I'm reworking a 15 year old script.
Here is the original general purpose routine that extracted a portion of one form to another form. Code: function FillForm(f) { for( i=FullName; i<=EndOfForm; i++) { self.document.forms[f].elements[i].value = FormData[i]; }; }; But NOW I'm supposed to use getElementById() Does that mean instead of the short routine I have to put one line for each Id tag and it is no longer general purpose and independent of the form being used? Is it OK to keep using the legacy script despite the Warning from the error console? Similar TutorialsIE is throwing an error stating window.document.forms[...].elements is null or not an object. in the following code Code: var changeHandler = function() { this.form.calculateDependencies(); return true; }; for(var i = 0; i < arguments.length; ++i) { for(var j = 0, e = window.document.forms[arguments[i]].elements; j < e.length; ++j) { addEvents([e[j]], ["change", "keyup", "focus", "click", "keydown"], changeHandler); e[j].hide = hideEl; e[j].show = showEl; } (e = window.document.forms[arguments[i]]).calculateDependencies = calcDeps; e.calculateDependencies(); } } FF and Chrome seem to work ok, but it breaks in IE. What am I doing wrong here? Hi All, I have a javascript application i have built http://dtp3.demodesign.co.uk/uploader/ Now this working in everything excluding IE but i don't under stand why it dose not work in IE it is a JSON Class that loads appends the content. and has an Iframe System to provide a powerful solution to work with AJAX to show file lists Any way if you go to that site it errors in Ie but work in every thing else any one got any idear why that is I need to validate some fields on a form. I have cut the script down to bare minimum to try to isolate the errors but no luck. This is the script Code: function verifyimages(){ var errorstatus = "groovey"; var errormsg = ""; var str = ''; var elem = document.getElementById('salespageform').elements; for(var i = 0; i < elem.length; i++) { document.write("file type: " + elem[i].type + " <br>" ); document.write(" value: " + elem[i].value + " <br>"); } if (errorstatus=="groovey"){ document.salespageform.submit(); return true; } else { alert(errormsg+"\n You can only upload a gif, jpg, jpeg or prn image"); return false; } } The form that calls this code has about 30 fields some text, some file, some hidden. When I replace the section that say Code: document.write("file type: " + elem[i].type + " <br>" ); document.write(" value: " + elem[i].value + " <br>"); with this Code: for(var i = 0; i < elem.length; i++) { str += "<b>Type:</b>" + elem[i].type + "  "; str += "<b>Name:</b>" + elem[i].name + " "; str += "<b>Value:</b><i>" + elem[i].value + "</i> "; str += "<BR>"; } document.write(str); it works fine. But what I really want to do is check that if the file type is "file" that the value is a jpeg, prn or gif. I know how to do that with regular expressions but I am getting errors -- different ones in IE and Firebox. So the first code presented throws this error in IE It displays the first file type and then errors with the message PERMISSION DENIED I also tried the following code in the for loop Code: for(var i = 0; i < elem.length; i++) { if (elem[i].type == "file"){ document.write('its a file'); } } that throws the error message that document.salespageform.submit is undefined these "seem" to work in firefox Any help is appreciated I wanted to know if document.getElementById works while accessing form elements. I tried doing this just for testing purposes This code doesnt work function validateForm() { var val = document.getElementById("id_login").getAttribute("value"); alert(val); return false; } but this does function validateForm() { alert(document.myForm.text_login.value ); return false; } Why doesnt document.getElementByid work with form objects.it works with all non form HTML objects.. Hi Coders, I have a javascript function which lets a user to choose one of the 7 option buttons on a "mainsub.asp" page and the page will then be forwarded to one of the 7 process pages depending on what has been chosen. The problem is that firefox is angry with the first line ("if" statement) and tells the following in its error console: Error: document.forms[0].C1 is not a function Source File: [localhost...] Line: 117 Here is the code: function fSubmit(){ if (document.forms[0].C1(0).checked) document.forms[0].action="process.asp"; else if (document.forms[0].C1(1).checked) document.forms[0].action="process1.asp"; else if (document.forms[0].C1(2).checked) document.forms[0].action="process2.asp"; else if (document.forms[0].C1(3).checked) document.forms[0].action="process3.asp"; else if (document.forms[0].C1(4).checked) document.forms[0].action="process4.asp"; else if (document.forms[0].C1(5).checked) document.forms[0].action="process5.asp"; else if (document.forms[0].C1(6).checked) document.forms[0].action="process6.asp"; else document.forms[0].action="process.asp"; return; } Internet explorer does not complain about anything and does its job great. But I could not figure out how to change the code to be also compliant with Firefox? Thanks for all the comments. I have one question about <style> elements, are they counted in document.styleSheets array? and can I add rules to them by using insertRule() and deleteRule() methods?
Normally I would just use document.getElementById to get anything I need but here is my problem: I have a zip code control that I load using AJAX. it has city, state, country, county and zip code. This gets loaded within a business application and at one point you can have both a bill to and ship to address forms on the screen at the same time, loading my zip control with the same fields, same ids and same name. This forced me to now pass in the form name that contains the control. I need to get to divs and spans within this form. Primarily as you type in a city or zip code, I am doing a hot search with a popup div that shows you results you can quickly choose from. The only time this becomes an issue is the situation I mentioned before when the zip code control is on the screen twice. I am not certain how to access the innerHTML of a span or div by way of the form name. Is this possible and if so what is the proper syntax? Here is a very basic example at its simplest form of my problem. Code: <form name="frm_billto" id="frm_billto"> <span id="myspan">Hello</span> </form> <form name="frm_shipto" id="frm_shipto"> <span id="myspan">World</span> </form> In the above example because the control was loaded twice, I now have 2 spans with the same ID. I want the innerHTML of the each span based on the form they are in. We wanted one control that we could use throughout the system that we could update in one place and the entire application be updated. Unfortunately we did not anticipate having it load more than once on the page. Thank you for any help I have this nice little piece of code that Bullant (CodingForum Senior Coder) helped me with. And it works flawlessly! I want to put it in the same document twice. I've tried to tweak the code so that each script is unique, but to no avail Both scripts work by themselves, but when placed together on the same page - the first one fails. Here is the test-site where it is being used: http://metrobilia.worldsecuresystems.com/stools.html# Here's what I'm doing (see below): Any help would be greatly appreciated! Code: <head> <link href="/stylesheets/styles.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> var picData = [ ['images/template2/fpo1_templ2.jpg','URL_for_one'], ['images/template2/fpo2_templ2.jpg','URL_for_two'], ['images/template2/fpo3_templ2.jpg','URL_for_three'] ]; //preload the images var oPics = []; for(i=0; i < picData.length; i++){ oPics[i] = new Image(); oPics[i].src = picData[i][0]; } function swapImage(obj){ oImgSwap.src = oPics[obj.indx].src; oImgSwap.parentNode.href = picData[obj.indx][1]; } window.onload=function(){ oImgSwap = document.getElementById('imgSwap'); oLinks = document.getElementById('radiobs').getElementsByTagName('a'); for(i=0; i < oLinks.length; i++){ oLinks[i].indx = i; oLinks[i].onclick=function(){ swapImage(this); return false; } } swapImage(oLinks[0]); } </script> <script type="text/javascript"> var picDatab = [ ['images/template2/fpo1_templ2b.jpg','URL_for_one'], ['images/template2/fpo2_templ2b.jpg','URL_for_two'], ['images/template2/fpo3_templ2b.jpg','URL_for_three'] ]; //preload the images var oPicsb = []; for(i=0; i < picDatab.length; i++){ oPicsb[i] = new Image(); oPicsb[i].src = picDatab[i][0]; } function swapImageb(obj){ oImgSwapb.src = oPicsb[obj.indx].src; oImgSwapb.parentNode.href = picDatab[obj.indx][1]; } window.onload=function(){ oImgSwapb = document.getElementById('imgSwapb'); oLinksb = document.getElementById('radiobsb').getElementsByTagName('a'); for(i=0; i < oLinksb.length; i++){ oLinksb[i].indx = i; oLinksb[i].onclick=function(){ swapImageb(this); return false; } } swapImageb(oLinksb[0]); } </script> </head> <div class="graphics_templ2" style="padding-left:217px;"> <div class="selections"> <div> <a href=""> <img src="" id="imgSwap" alt="" /> </a> </div> <div id="radiobs"> <div class="single_box"> <a href="#"><img src="/images/template2/sample_box_1_fpo.jpg" width="30" height="30" alt="Sample Box Fpo"></a> <h2>Color 1</h2> </div> <div class="single_box"> <a href="#"><img src="/images/template2/sample_box_2_fpo.jpg" width="30" height="30" alt="Sample Box Fpo"></a> <h2>Color 1</h2> </div> <div class="single_box"> <a href="#"><img src="/images/template2/sample_box_3_fpo.jpg" width="30" height="30" alt="Sample Box Fpo"></a> <h2>Color 1</h2> </div> </div> </div> </div> <div class="graphics_templ2" style="padding-left:15px;"> <div class="selections"> <div> <a href=""> <img src="" id="imgSwapb" alt="" /> </a> </div> <div id="radiobsb"> <div class="single_box"> <a href="#"><img src="/images/template2/sample_box_1_fpob.jpg" width="30" height="30" alt="Sample Box Fpo"></a> <h2>Color 1</h2> </div> <div class="single_box"> <a href="#"><img src="/images/template2/sample_box_2_fpob.jpg" width="30" height="30" alt="Sample Box Fpo"></a> <h2>Color 1</h2> </div> <div class="single_box"> <a href="#"><img src="/images/template2/sample_box_3_fpob.jpg" width="30" height="30" alt="Sample Box Fpo"></a> <h2>Color 1</h2> </div> </div> </div> </div> Good morining, I'm working on a javascript for a rollover menu that the client is regularly changing. I want to create a call to a remote "document write" script on each page so that when it changes I only have to modify it in the script rather than on every page of the site. The problem I am having is that I cannot figure out how to include the quotes needed to execute the rollovers without killing the script. I tried removing all the quotes, and the "\" method as I would with a perl script, (and MANY other attempts) but no go. Here is where I'm at right now. I would appreciate any suggestions or links to info I can read to learn from. Call to the script in the html page(s): Code: <SCRIPT language="JavaScript" SRC="Nav_11Set.js"></SCRIPT> The script (condensed to one image): Code: document.write('<table id=Table_01 width=143 height=264 border=0 cellpadding=0 cellspacing=0><tr><td><a href=http://www.minersalley.com/Memberships.html onmouseover=changeImages('Nav_11Set_01', 'images/Nav_11Set_01-over.jpg'); return true;onmouseout=changeImages('Nav_11Set_01', 'images/Nav_11Set_01.jpg'); return true;onmousedown=changeImages('Nav_11Set_01', 'images/Nav_11Set_01-down.jpg'); return true; onmouseup=changeImages('Nav_11Set_01', 'images/Nav_11Set_01-over.jpg'); return true;><img name=Nav_11Set_01 src=images/Nav_11Set_01.jpg width=143 height=24 border=0 alt=Membership Info!></a></td></tr></table>') Hello. I have a script that detects the image size of a url and then shows a resized version of the image if it's necessary to resize. (this script was provided to me by the user bullant, thank you.) (Script will be shown later further down) In order to display the resized image, I must specify the id tag of myImg(and a number) in the img tag and must have an equal number of urls in the script as I do img tags. So, if I have three images I need to do the following to get them to appear. Code: <div><img id="myImg0" src='' alt="" /></div> <div><img id="myImg1" src='' alt="" /></div> <div><img id="myImg2" src='' alt="" /></div> And this is the script (it can go right below the above code and all in the body tag): Code: <script type="text/javascript"> var picUrl = [ 'http://localhost/test/pic1.jpg', 'http://localhost/test/pic2.jpg', 'http://localhost/test/pic3.jpg', ]; //create image objects oPic = new Array(); for(i=0; i < picUrl.length; i++){ oPic[i] = new Image(); oPic[i].src = picUrl[i]; } window.onload=function(){ var maxWidth = 200; var maxHeight = 200; for(i=0; i < oPic.length; i++){ var width = oPic[i].width; //original image width var height = oPic[i].height; //original image height //set the image size to display on the page var newDims = calcNewDimensions(width, height, maxWidth, maxHeight); document.getElementById('myImg'+i).width = newDims['width']; document.getElementById('myImg'+i).height = newDims['height']; document.getElementById('myImg'+i).src = oPic[i].src; } } function calcNewDimensions(width, height, maxWidth, maxHeight){ newDims = new Array(); //scaling factors var xRatio = maxWidth / width; var yRatio = maxHeight / height; //calculate the new width and height if(width <= maxWidth && height <= maxHeight) { //image does not need resizing newDims["width"] = width; newDims["height"] = height; } else if(xRatio * height < maxHeight) { newDims["height"] = Math.round(xRatio * height); newDims["width"] = maxWidth; } else { newDims["width"] = Math.round(yRatio * width); newDims["height"] = maxHeight; } return newDims; } </script> O.k. Now, I have the following I am working with: Code: <!--Image 5--> <img src="http://blahblah.com/images/red2.jpg" alt="Item photo" onmouseover="document.swap.src='http://blahblah.com/images/red2.jpg';" height="80"> in which you can see that onmouseover, a larger image is shown (it's not rescaled). You can also see that the url of an img is specified there. How can I get the rescaled image to show in that spot or the url from the picUrl Array and the image shown in the correct size, in that spot of Code: onmouseover="document.swap.src= ? This is the entire area in which the onmouseover code will be used in case you need it. Code: <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"> <title>MouseOver-Images</title> <style type="text/css"> td#kdwhdMAINPHOTO { width: 616px; vertical-align: top; } table#kdwhdTHUMB { margin-top: 12px; } td#kdwhdTHUMBNAILS { background-image: url(http://www.sunandfuninoc.com/testingsites/gems4me/images/t_28.jpg); width: 616px; height: 114px; text-align: center; } td#kdwhdTHUMBNAILS img { border: 1px solid #696969; } td#kdwhdTABLE { width: 296px; vertical-align: top; } --> </style> </head> <body> <table style="width: 924px;" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td id="kdwhdMAINPHOTO" style="text-align: center; background-color: white;"> <!--Image 1--> <img src="http://site.gems4me.com/images/red2.jpg" alt="Item photo" name="swap" style="border: 0px solid rgb(105, 105, 105);" height="450" width="450"> <table id="kdwhdTHUMB" border="0" cellpadding="0" cellspacing="0" width="616"> <tbody> <tr> <td><img src="http://www.sunandfuninoc.com/testingsites/gems4me/images/t_26.jpg" alt="Click on the picture below to enlarge" height="25" width="616"></td> </tr> <tr> <td><img src="http://www.sunandfuninoc.com/testingsites/gems4me/images/t_27.jpg" alt="" height="10" width="616"></td> </tr> <tr> <td id="kdwhdTHUMBNAILS"><!--Image 1--><img src="http://site.gems4me.com/images/450by450.jpg" alt="Item photo" onmouseover="document.swap.src='http://site.gems4me.com/images/450by450.jpg';" height="80"> <!--Image 2--> <img src="http://site.gems4me.com/images/450by450-2.jpg" alt="Item photo" onmouseover="document.swap.src='http://site.gems4me.com/images/450by450-2.jpg';" height="80"> <!--Image 3--> <img src="http://site.gems4me.com/images/450by450.jpg" alt="Item photo" onmouseover="document.swap.src='http://site.gems4me.com/images/450by450.jpg';" height="80"> <!--Image 4--> <img src="http://site.gems4me.com/images/450by450-2.jpg" alt="Item photo" onmouseover="document.swap.src='http://site.gems4me.com/images/450by450-2.jpg';" height="80"> <!--Image 5--> <img src="http://site.gems4me.com/images/red2.jpg" alt="Item photo" onmouseover="document.swap.src='http://site.gems4me.com/images/red2.jpg';" height="80"></td> </tr> <tr> <td><img src="http://www.sunandfuninoc.com/testingsites/gems4me/images/t_29.jpg" alt="" height="10" width="616"></td> </tr> </tbody> </table> </td> <td><img src="http://www.sunandfuninoc.com/testingsites/gems4me/images/spacer.gif" alt="" height="1" width="12"></td> <td id="kdwhdTABLE"> <table border="0" cellpadding="5" cellspacing="0" width="296"> <tbody> <tr> <td colspan="2" id="kdwhdTABLETITLE">Stuff</td> </tr> <tr> <td class="kdwhdSPECR1C1" nowrap="nowrap">Stuff</td> <td class="kdwhdSPECR1C2">Stuff</td> </tr> <tr> <td class="kdwhdSPECR2C1" nowrap="nowrap">Stuff</td> <td class="kdwhdSPECR2C2">Stuff </td> </tr> <tr> <td class="kdwhdSPECR2C1" nowrap="nowrap">Stuff</td> <td class="kdwhdSPECR2C2">Stuff</td> </tr> <tr> <td class="kdwhdSPECR2C1" nowrap="nowrap">Stuff</td> <td class="kdwhdSPECR2C2">Stuff</td> </tr> <tr> <td class="kdwhdSPECR2C1" nowrap="nowrap">Stuff</td> <td class="kdwhdSPECR2C2">Stuff</td> </tr> <tr> <td class="kdwhdSPECR2C1" nowrap="nowrap">Stuff</td> <td class="kdwhdSPECR2C2">Stuff</td> </tr> <tr> <td class="kdwhdSPECR2C1" nowrap="nowrap">Stuff</td> <td class="kdwhdSPECR2C2">Stuff</td> </tr> <tr> <td class="kdwhdSPECR2C1" nowrap="nowrap">Stuff</td> <td class="kdwhdSPECR2C2">Stuff</td> </tr> <tr> <td class="kdwhdSPECR2C1" nowrap="nowrap">Stuff</td> <td class="kdwhdSPECR2C2">Stuff</td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </body> </html> so my code is supposed to retrieve three values from a flash element. now it works fine, but when it retrieves a 0 from any of the three valuse, it goes all haywire.... how could i put in a statement or command that if it returns 0, that all it will display is a 0 instead of returning "NaN"? But since all three valuse added together are supposed to equal 100% i have to run the numbers through a little bit of division and rounding after it gets the value of each one. Code: var techfaction = document.getElementById('tfaction'); var natfaction = document.getElementById('nfaction'); var magfaction = document.getElementById('mfaction'); retrFaction(); roundNumber(); function retrFaction() { var values = document.documentElement.innerHTML.match(/factiontrianglesmall\.swf\??.*\\x26link/i)[0].match(/[0-9.]{4,9}/ig); techfaction.innerHTML = roundNumber(values[0] / 30, 1) + '%'; natfaction.innerHTML = roundNumber(values[1] / 30, 1) + '%'; magfaction.innerHTML = roundNumber(values[2] / 30, 1) + '%'; } function roundNumber(num, dec) { var result = Math.round(num*Math.pow(10,dec))/Math.pow(10,dec); return result; } Hi, I'm a javascript idiot, and I need a script to change two styles in two different elements based on the status of 2 radio buttons. Basically, I have 2 forms...#formTest and #formTest2. When radio button "search" value "1" is selected I need the display style for #formTest to be "block" and the display style for #formTest2 to be "none". When radio buton "search" value "2" is selected, I need the opposite to occur. (#formTest display style ="none" and #formTest2 display style="block") I have very buggy code which produces similar changes, but does other bad things, so won't work. Basically, the first selection change displays both forms, which after the first selection change works fine, unless you click anywhere else, in which case both forms are not displayed. I know I should use a function in the head and call it with an onselect or onclick event. I just don't know how. I appreciate any help anyone can offer me! My ugly (nonfunctional code is below) Search by Make: <input name="search" type="radio" value="1" onclick="document.getElementById('testForm').style.display='block';" onchange="document.getElementById('testForm').style.display='none';" checked="checked" /> <br /> Search by Category: <input name="search" type="radio" value="2" onclick="document.getElementById('testForm2').style.display='block';" onchange="document.getElementById('testForm2').style.display='none';" /> Thanks Again Hi guys, it's been a while since I've been here Anyways, I'm wondering if it's possible for a script to enable/disable all input elements on the page with some sort of toggle button. I googled it but didn't find anything too useful except for this: http://www.aHappyDeal.com/wj_r.asp?lid=2109 but I'm not sure how to edit it for the toggle. Thanks! Hi guys, it's been a while since I've been here Anyways, I'm wondering if it's possible for a script to enable/disable all input elements on the page with some sort of toggle button. I googled it but didn't find anything too useful except for this: http://www.codetoad.com/javascript/e...rm_element.asp but I'm not sure how to edit it for the toggle. Thanks! hi. in reference to this post: http://www.codingforums.com/showthread.php?t=226228 can some guru show me how to modify the matching columns script so that it works in html5? .. with a long center SECTION element and two shorter ASIDE elents .. 1 on each side. UPDATE .. Houston, we have an answer. I've got this script working for grabbing and scrolling a website, and it's perfect; the only problem is I'd like to disable it when clicking a form (basically, not being able to drag scroll when clicking inside a form or input tag). This could be either by specifying a class or ID, whatever works best. This is the script, in case the website goes down or something: Code: <script type="text/javascript"> document.onmousedown = function(){ var e=arguments[0]||event; var x=zxcWWHS()[2]+e.clientX; var y=zxcWWHS()[3]+e.clientY; document.onmousemove=function(){ var e=arguments[0]||event; window.scroll(x-e.clientX, y-e.clientY); return false; } document.onmouseup=function(){ document.onmousemove=null; } return false; } function zxcWWHS(){ if (window.innerHeight) return [window.innerWidth-10,window.innerHeight-10,window.pageXOffset,window.pageYOffset]; else if (document.documentElement.clientHeight) return [document.documentElement.clientWidth-10,document.documentElement.clientHeight-10,document.documentElement.scrollLeft,document.documentElement.scrollTop]; else if (document.getElementById("mailForm").onmousedown=null); return [document.body.clientWidth,document.body.clientHeight,document.body.scrollLeft,document.body.scrollTop]; } </script> Also, would there be a way to enable grab scrolling just on the background? I mean, disabling it on images, text and any other element, and just leaving the empty spaces of the website with the ability to scroll. Thanks a lot in advance. My code is here and it works ... However, I would like my dynamic table to show on the same page as my body and not on a new blank page. I have created a DIV and try playing around with the document.getElementById('monTab').innerHTML but it's not working out for me ... What am i missing ? Regards, Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD><TITLE>new Script - Javascript Cours 11</TITLE> <META content="text/html"; charset="UTF-8" http-equiv="content-type"> <SCRIPT type="text/javascript"> function createTable(){ var Etudiant = new Array(Number(prompt("How many Students will you put in ?",""))); document.write("<table border=\"1\">"); for (var i=0; i<Etudiant.length; i++) { Etudiant[i] = window.prompt("S'il vous plait entrez le nom d'un etudiant " + (i+1) + ".","") alert("Nice to see you "+Etudiant[i]); document.write("<td>"+Etudiant[i]+"</td>"); j = parseInt(prompt("Combien de notes voulez vous calculez ?")); for (h=0;h<j;h++){ notes[h] = parseInt(prompt("S'il vous plait entrez la "+(h+1)+" note de "+Etudiant[i])); document.write("<td>"+notes[h]+"</td>"); } document.write("<tr>"); } document.write("</tr>"); document.write("</table>"); document.getElementById('monTab').innerHTML=Etudiant; } </script> <BODY> <H1>Combien de note voulez vous cumulez ?</H1> <br> <br> <input type="button" name="btnSubmit" value="TRY IT" onclick="createTable()"> <div id="monTab" size="10"> Content should come here ...Content should come here ...Content should come here ...Content should come here ...Content should come here ...Content should come here ...Content should come here ... </div> </BODY> </HTML> I'm using the autofill forms plugin for firefox which can be found he https://addons.mozilla.org/en-US/firefox/addon/4775 I use it to automatically fill various web forms, duh. But I would like certain values to be chosend randomly from a list I create. I contacted the developer and he said the add on probably does not need a new feature because there is a 'dynamic tags' function to fill certain forms with dynamic values (e.g. the current time or date). He has given over the project to another developer and told me I probably would find a solution in a good javascript programming forum. So here I am! Can anyone help me with this? Basically, I just need a javascript code which chooses on item from an array randomly, I guess? I'm not a programmer myself, so any help would be greatly (!) appreciated. Thanks a lot in advance for any further guidance! Note: Here are sample dynamic tags from the plugin: <datetime> new Date().toLocaleString() <useragent> navigator.userAgent <langcode> navigator.language <resolution> screen.width+'x'+screen.height <clipboard> this.getClipboardText() I found this line in one of the scripts on javascript.kit <code> if(document.layers|| document.getElementById|| document.all) </code> Could someone give me an idea on why this line would be used in a code? Thank you very much |