JavaScript - Help To Display Ie6 Warning
All,
If a user is going to my site with IE7 or less I call the following JS file. Code: // JavaScript Document var ie6_warning=navigator.userAgent.indexOf('MSIE 6') if (ie6_warning > 0) { document.write("<div style='border: 1px solid #F7941D; background: #FEEFDA; text-align: center; clear: both; height: 75px; position: relative; z-index:5000'> <div style='position: absolute; right: 3px; top: 3px; font-family: courier new; font-weight: bold;'><a href='#' onclick='javascript:this.parentNode.parentNode.style.display=\"none\"; return false;'><img src='http://info.template-help.com/files/ie6_warning/ie6nomore-cornerx.jpg' style='border: none;' alt='Close this notice'/></a></div> <div style='width: 740px; margin: 0 auto; text-align: left; padding: 0; overflow: hidden; color: black;'> <div style='width: 75px; float: left;'><img src='http://info.template-help.com/files/ie6_warning/ie6nomore-warning.jpg' alt='Warning!'/></div> <div style='width: 275px; float: left; font-family: Arial, sans-serif; color:#000'> <div style='font-size: 14px; font-weight: bold; margin-top: 12px; color:#000'>You are using an outdated browser</div> <div style='font-size: 12px; margin-top: 6px; line-height: 12px; color:#000'>For a better experience using this site, please upgrade to a modern web browser.</div> </div><div style='width: 75px; float: left;'><a href='http://www.firefox.com' rel="nofollow" target='_blank'><img src='http://info.template-help.com/files/ie6_warning/ie6nomore-firefox.jpg' style='border: none;' alt='Get Firefox 3.5'/></a></div><div style='width: 75px; float: left;'><a href='http://www.browserforthebetter.com/download.html' rel="nofollow" target='_blank'><img src='http://info.template-help.com/files/ie6_warning/ie6nomore-ie8.jpg' style='border: none;' alt='Get Internet Explorer 8'/></a></div> <div style='width: 73px; float: left;'><a href='http://www.apple.com/safari/download/' rel="nofollow" target='_blank'><img src='http://info.template-help.com/files/ie6_warning/ie6nomore-safari.jpg' style='border: none;' alt='Get Safari 4'/></a></div> <div style='float: left; width: 73px;'><a href='http://www.google.com/chrome' rel="nofollow" target='_blank'><img src='http://info.template-help.com/files/ie6_warning/ie6nomore-chrome.jpg' style='border: none;' alt='Get Google Chrome'/></a></div><div style='float: left;'><a href='http://www.opera.com/' rel="nofollow" target='_blank'><img src='http://info.template-help.com/files/ie6_warning/ie6nomore-opera.jpg' style='border: none;' alt='Opera'/></a></div> </div></div>" );} Right now it only goes 75pixels. How can I make it so that it spans the whole screen of the users computer? Thanks in advance! Similar TutorialsI am getting a JavaScript warning: Quote: Use of getAttributeNode() is deprecated. Use getAttribute() instead. It is triggered when I type in a HTML TEXTAREA. This is the relevant code: Code: <SCRIPT type="text/javascript"> function validateForm() { if (document.forms["form"]["feedback"].value == "") { alert ("Cannot submit because feedback has not been given."); return false; } } </SCRIPT> Code: <FORM action="result.html" method="post" name="form" validateForm()"> <DIV> <DIV class="feedback"><TEXTAREA class="feedback" cols="0" name="feedback" rows="0"></TEXTAREA></DIV> <BR> <BR> <INPUT class="verdana" type="submit" value="SUBMIT"> </DIV> </FORM> Why am I getting a warning about getAttributeNode() when I'm not even using it? Hi, I am setting up a form with a submit button. I want a warning box to come up saying you are about to delete user ?? image Click ok to continue or cancel Can someone give me the code please? Hello. I'm coding a simple hover-opacity thing for some images on my site on the navigation bar. Although I'm receiving this message in my Firebug. uncaught exception: Syntax error, unrecognized expression: . Here's the navigation code: Code: <div class="navigation"> <a href="home"><img class="home" src="images/navigation/home.gif" /></a> - <a href="home" class="home">Home</a> <a href="news"><img class="news" src="images/navigation/news.gif" /></a> - <a href="news" class="news">News</a> </div> So the effect I've made is, when I hover the image, its opacity gets set to 1. And when I move my mouse away the image changes opacity to .5 And when I hover the text "Home" or "News" the same effect happens with the image. And here's my jQuery: Code: $(function(){ $('.navigation img').css({ opacity: .5 }); $('.navigation img').hover(function(){ $(this).stop().animate({ opacity: 1 },300); }, function(){ $(this).stop().animate({ opacity: .5 },300); }); $('.navigation a').hover(function(){ var imageClass = $(this).attr('class'); $('.navigation img.' + imageClass).stop().animate({ opacity: 1 }, 300); }, function(){ var imageClass = $(this).attr('class'); $('.navigation img.' + imageClass).stop().animate({ opacity: .5 }, 300); }); }); I can't seem to find the error in my script(s). Any help is appreciated. EDIT: Apparently the error appears when I make anchor tags around the image. Code: <a href="home"><img ... /></a> This gives the error. :S Code: <img ... /> But this doesn't? How can this be? I have a program written in Javascript (saved as an HTML file that I run from my desktop by launching it in IE) which works fine on my system. Running IE 8 in Vista on one system and XP on another. When I launch the file, I get warning in the information bar: "To help protect your security, Internet Explorer has restricted this webpage from running scripts or ActiveX cntrols that could access your computer. Click here for optons..." I actually WANT this warning. When I click through it to accept, the program works fine. But about half of the people that I share this program with are not getting this warning, and it appears that the javascript never runs. At first I thought it was something in Windows 7, because two of the users were running on that OS, and I've found a number of issues described online about having problems running scripts in IE8/Win7. But the latest user is also running Vista, like me. His security settings are set to the default, Medium-High. But he's still not getting the script/ActiveX warning in the message bar. Anyone know how we can enable that warning? Thanks! i am getting security alert from microsot internet explorer. when i click on image icon,which will open a new window. message which i get is Do you want to view only the webpage content that was deliverd securely? This webpage contains content that will not be delivered using a secure HTTPS connection,which could compermise the security of the entire webpage. YES NO Actualy my application is on https//.... which will call http://... because of that i get this issue. i know i can bypass this with doing some settings in internet explorer. But my client wants me to do through java script coding so that they could not see this message at all. Please give suggestions. Thanks in Advance !! I know this looks like I'm spamming for clients, but I have plenty, thankyouverymuch, I just would like your coding help promise I'm a self-taught programmer and working on a couple of my adult sites, and I think it's time I actually figure out how to do a good content warning popup. I would like to be able to link to every page on my site without having to go through my content warning landing page - any ideas? I've seen it done using I believe Java and Ajax in Wordpress, but I'm not using WordPress. And I of course don't want it to popup every time I go to a page on my site. WARNING!!!! links take you to adult content!!!!!! First site: http://stellabrolin.com - this one is basic, all within one domain, no subdomains Second site: http://theroxxbabes.com, sub domains http://hellen.theroxxbabes.com and http://stella.theroxxbabes.com I have 2 subdomains, but I want the same rules to apply; if linked to a page within a subdomain I want the content warning to show, and then a link to the main domain is clicked, I don't want the content warning to show again - how do I do this? am I overthinking this? does this make sense? thanks in advance!! Hello all, i am new to this forum.. i am validating a form and displaying results.. but, instead of displaying the result in popup(alert), i need to display it as a text that disappears after a few seconds.. Code: function valtext() { if(document.getElementById("functional").value == "") { document.getElementById("label").innerHTML=message; startTimer(); } } function hideMessage() { document.getElementById("label").style.display="none"; clearTimeout(tim); } function startTimer() { tim = setTimeout("hideMessage()",3000); } i did it using the above code.. but my problem is, i cant check it the second time, without reloading the page.. how to do it without refreshing the page and i want to add a bg color to that warning.. how to do that.. and, is there anyother way of doing it? any help is much appreciated.. and thanks Hi, I have a form that when you click submit gives a warning box asking if to continue code below Now when I type in the text field and press enter it doesn't submit nor does it pop up the warning box, how would I do this Code for submit button Code: <script LANGUAGE="JavaScript"> <!-- function submitMyForm() { var agree=confirm("ARE YOU SURE ?"); if (agree) return true ; else return false ; } // --> </script> Code: <form action="admin-delete.php" method="post" name="cp_delete" id="cp_delete"> <input type="text" name="cp_delete_bg" id="cp_delete_bg"> <input type="submit" name="submit" value="submit" onclick="return submitMyForm()"/> </form> Hello, I'm writing a very simple code. Basically, there will be an array of strings from which one is randomly chosen and written to an element on the page. Here is a simplified version of how I'm executing it: Code: <html> <head> <script type="text/javascript"> function dyk() { document.getElementById('test').innerHTML = "foobar"; } </script> </head> <body onLoad="dyk();"> <div id="test">Hello<br /> </div> </body> </html> My only concern is the "Active Content" warning that comes up in IE. The clientele (mostly older people) are probably going to be IE users and many of them might be so untrusting of computers that they'll take the warning as a legitimate concern. Is there another way to write this simple code to avoid the warning? Thanks, Chris [Edit: I realize that the end user could disable such a warning, but I'm more wondering if there's a way to develop around it. Also, if it makes any difference, I've been viewing my page off of my computer, rather than from some source on the internet. Would uploading it to view it change whether the warning appears?] Why isnt this working? Code: function display_form(obj) { var button_name = obj.id.split("dialog_"); var t = document.getElementById(button_name[1] + '_form').style.visibility = 'visible'; alert(t); } IE is saying: Code: id is 'null' or not an object I'm trying to set an if statement so if one element is set to display:none, another element(s) sets margin-left to a certain number of pixels. Sort of like this (however, it's not working): Code: <script> if (document.getElementById('#why-choose-content').style.display = 'none') { document.getElementById('#always-content').style.margin-left = '335px'; } </script> Here is the site in question: http://bit.ly/8XfM0Q You can get a better idea of what I mean by clicking the 'plus' icons for the three colored tabs above the main content. Or if anybody has a more elegant way to get the divs to toggle under their respective headers, I'd love to hear. Thank you. Hello everyone, I need help to show popup only once a day per user! The Problem is that the users of my blog gets mad when the popup displays, so i only want to show it once a day. please add the codes to it fully and send it back over thanks! [CODE]<link href='http://pwnagesource.netii.net/java/jquery.fancybox.css' media='screen' rel='stylesheet' type='text/css'/> <!--[if lte IE 6]><link href="java/jquery.fancybox_ie.css" media="screen" rel="stylesheet" type="text/css" /><![endif]--> <script src='http://pwnagesource.netii.net/java/jquery-1.4.3.min.js' type='text/javascript'/> <script src='http://pwnagesource.netii.net/java/jquery.fancybox-1.3.4.js' type='text/javascript'/> <script type="text/javascript"> $j = jQuery.noConflict(); $j.fn.countDown = function(settings,to) { settings = jQuery.extend({ startFontSize: '14px', endFontSize: '14px', duration: 1000, startNumber: 10, endNumber: 0, callBack: function() { } }, settings); return this.each(function() { //where do we start? if(!to && to != settings.endNumber) { to = settings.startNumber; } //set the countdown to the starting number $j(this).text(to).css('fontSize',settings.startFontSize); //loopage $j(this).animate({ 'fontSize': settings.endFontSize },settings.duration,'',function() { if(to > settings.endNumber + 1) { $j(this).css('fontSize',settings.startFontSize).text(to - 1).countDown(settings,to - 1); } else { settings.callBack(this); } }); }); }; </script> <script type="text/javascript"> $j(function() { $j.fancybox( "<div style='margin-left: 20px;'></br><h3 style='background-color: #000; padding: 8px; color: white; text-shadow: white 1px 2px 2px;-moz-text-shadow: black 1px 2px 2px;-webkit-text-shadow: black 1px 2px 2px;font-weight: bold;font-family: \"Trebuchet MS\", Helvetica, Geneva, san-serif; font-size: 20px; '>TheEmoLab" | Subscribe To Our Newsletter!</h3><center></br><td align='left'> <p style='color:#666; font-style:italic; margin:0px 0px 5px 0px; '>Get Free Email Updates Daily!</p></td><form action='http://feedburner.google.com/fb/a/mailverify' class='emailform' method='post' onsubmit='window.open('http://feedburner.google.com/fb/a/mailverify?uri=theemolab/feed', 'popupwindow', 'scrollbars=yes,width=550,height=520');return true' style='margin: 0pt;' target='popupwindow'><input name='uri' type='hidden' value='theemolab/feed'/><input name='loc' type='hidden' value='en_US'/><input class='mbttext' name='email' onblur='if (this.value == "") {this.value = "Enter your email...";}' onfocus='if (this.value == "Enter your email...") {this.value = ""}' type='text' value='Enter your email...'/><input alt='' class='mbtbutton' title='' type='submit' value='Submit'/></form></tr></tbody></table></center></br><hr style='padding-bottom: 0; margin: 0 0 7px 0;' /><p style='padding-bottom:0;text-align: center; font-weight: bold;margin-top: 0; padding-top:0;'>This dialog box will close in <span id='dialog_close_countdown'>30</span> seconds.</p></div>", { 'autoDimensions' : false, 'width' : 500, 'height' : 215, 'overlayOpacity' : '0.8', 'overlayColor' : '#000', 'onComplete' : function() { $j('#dialog_close_countdown').countDown({ startNumber: 30, callBack: function(me) { $j.fancybox.close(); } }); } }); }); </script>[ICODE] Hi, I thought this would be relatively simple, but it's more complicated than I thought, and I can't seem to find the question resolved anywhere. My problem is that on my site I sometimes have promotions that will end at midnight. I have to physically change the code at midnight to remove the promotional material. How would one go about using Javascript to only display a <div> during a certain time? Like "Use coupon code 123 to get free shipping! Good until midnight!" and set it to stop displaying that content at 12:00 AM. Then I could remove it the next day. Or the opposite, and have it take effect a midnight, etc. I'm sure it's been done before, right? The navigation for the web site I'm doing requires JS to remotely work so I want to make some kind of back-up scenario. Basicly, how can I make it so my main navigation will only display if there is script? One thought I had was put it in a div, hide it in the CSS, then use JS to show it but if there is a better way to do this I'd like to know. I'm using php to write nested div's to a page. The div's display depending on a condition PHP Code: (if condition true) echo "<script type='text/javascript'>display(divID1);</script>"; echo "<div id='divID1'>"; (if condition true) echo "<script type='text/javascript'>display(divID2);</script>"; echo "<div id='divID2'>"; echo "<table id='tableID'><tr><td></td></tr></table>"; This is the javascript function Code: <script type='text/javascript'> function display(id) { document.getElementById(id).style.display='block'; } </script> while both divs have {display: none;} as default, the outer div {border:solid;} does display but inner div {border:solid;} does not display. I've tried this: PHP Code: (if condition true) echo "<script type='text/javascript'>display(divID);</script>"; echo "<div id='divID1'>"; (if condition true) echo "<script type='text/javascript'>display(tableID);</script>"; echo "<table id='tableID'><tr><td></td></tr></table>"; then display using block, inline-block, table, inline-table, and still the inner element div or table will not display. Can anyone help me with this? hi, i am currently doing a program that will display the image continuously. the image name will be like pic1.jpg , pic2.jpg , pig3.jpg untill pic10.jpg this is my code so far : <html> <head> <script type="text/JavaScript"> var fileName; function display() { fileName = new Array(); for( i=0; i<5; i++) { fileName[i] = new Image(); fileName[i].src = "screenshot_" + i + ".jpeg"; } } display(); </script> </head> <body> </body> </html> but when i run it, it give me infinity loop, can anyone tell me what is the problem of that ? thanks in advance for the reply Hi, I have an application wherein for one page I want to display a Listbox on selection of a radio button. There should be 2 radio buttons and when the user clicks on the 2nd one "My Process", a list box should be displayed with several options. Can anybody pls help me with this as I'm a beginner to JS.. Many thanks Pooja. Hi. this is my code for a form i am working on, i want it so that when "Non_Conformance_Type" = ID1 that <tbody id="ID1" style="display: none;"> </tbody> is displayed. Code: <script type="text/javascript"> // <![CDATA[ function display(obj,id1,id2,id3,id4,id5,id6,id7,id8) { txt = obj.options[obj.selectedIndex].value; document.getElementById(id1).style.display = 'none'; document.getElementById(id2).style.display = 'none'; document.getElementById(id3).style.display = 'none'; document.getElementById(id4).style.display = 'none'; document.getElementById(id5).style.display = 'none'; document.getElementById(id6).style.display = 'none'; document.getElementById(id7).style.display = 'none'; document.getElementById(id8).style.display = 'none'; if ( txt.match(id1) ) { document.getElementById(id1).style.display = 'block'; } if ( txt.match(id2) ) { document.getElementById(id2).style.display = 'block'; } if ( txt.match(id3) ) { document.getElementById(id2).style.display = 'block'; } if ( txt.match(id4) ) { document.getElementById(id2).style.display = 'block'; } if ( txt.match(id5) ) { document.getElementById(id2).style.display = 'block'; } if ( txt.match(id6) ) { document.getElementById(id2).style.display = 'block'; } if ( txt.match(id7) ) { document.getElementById(id2).style.display = 'block'; } if ( txt.match(id8) ) { document.getElementById(id2).style.display = 'block'; } } // ]]> </script> and... Code: <div id='Type_Non_Conformance_container'> <select name='Type_Non_Conformance' id='Type_Non_Conformance' size='1' onchange="display(this,ID1,ID2,ID3,ID4,ID5,ID6,ID7,ID8)"> <option value='' %Type_Non_Conformance%></option> <option value='ID1' %e89cf9a575493ea05184443c64bf031d%>Can Not Locate Product</option> <option value='ID2' %4cf35d2927674904ba13019f94f16827%>Can Not Locate Email</option> <option value='ID3' %8939f9a23e7bc218f93e8b223a364924%>Item Adjustment</option> <option value='ID4' %27c35559235fb503e7fba0f1896cd4f2%>Missing Shipping Instructions</option> <option value='ID5' %304931fb92d418057887a6b0727d83e7%>Partial Shippment Release</option> <option value='ID6' %76bf955f6d4ce8498b71b82d16c656a9%,>Lost Sale</option> <option value='ID7' %f7fa215ea76de432e1c83d283441c798%>Transfer/Order Did Not Ship</option> <option value='ID8' %b6ed7f7429483a76bc42a5b26a1bbb3e%>Other</option> </select> </div> and... Code: <tbody id="ID1" style="display: none;"> <div id='heading_container'> <div id='heading'>Can Not Locate Product</div> </div> <div id='Order_Transfer_Number_1_ID1_container'> <input type='text' name='Order_Transfer_Number_1_ID1' id='Order_Transfer_Number_1_ID1' value='%Order_Transfer_Number_1_ID1%' size='20' class='sfm_textbox'/> </div> <div id='Order_Transfer_Number_2_ID1_container'> <input type='text' name='Order_Transfer_Number_2_ID1' id='Order_Transfer_Number_2_ID1' value='%Order_Transfer_Number_2_ID1%' size='20' class='sfm_textbox'/> </div> <div id='label8_container'> <label id='label8' for='Order_Transfer_Number_1_ID1' class='sfm_form_label'>Order/Transfer #</label> </div> <div id='label9_container'> <label id='label9' for='Order_Transfer_Number_2_ID1' class='sfm_form_label'>-</label> </div> <div id='Taker_Number_ID1_container'> <input type='text' name='Taker_Number_ID1' id='Taker_Number_ID1' onkeypress='return sfm_decimal_key_handler(this, event,".")' value='%Taker_Number_ID1%'/> </div> <div id='label7_container'> <label id='label7' for='Taker_Number_ID1' class='sfm_form_label'>Taker #</label> </div> <div class='element_label' id='Order_Transfer_ID1_0_container'><input type='radio' name='Order_Transfer_ID1' id='Order_Transfer_ID1_radio_0' value='Order' %24304b44337785c961add086070b3981%/><label for='Order_Transfer_ID1_radio_0' class='element_label' id='Order_Transfer_ID1_radio_0_label'>Order</label></div> <div class='element_label' id='Order_Transfer_ID1_1_container'><input type='radio' name='Order_Transfer_ID1' id='Order_Transfer_ID1_radio_1' value='Transfer' tabindex='1' %9b4d481b434f7128f666cbc9a19d7c7a%/><label for='Order_Transfer_ID1_radio_1' class='element_label' id='Order_Transfer_ID1_radio_1_label'>Transfer</label></div> <div id='label10_container'> <label id='label10' for='Product_Number_ID1' class='sfm_form_label'>Part #</label> </div> <div id='Picker_Name_Last_ID1_container'> <input type='text' name='Picker_Name_Last_ID1' id='Picker_Name_Last_ID1' value='%Picker_Name_Last_ID1%' size='20' class='sfm_textbox'/> </div> <div id='Product_Number_ID1_container'> <input type='text' name='Product_Number_ID1' id='Product_Number_ID1' value='%Product_Number_ID1%' size='20' class='sfm_textbox'/> </div> <div id='Picker_Name_First_ID1_container'> <input type='text' name='Picker_Name_First_ID1' id='Picker_Name_First_ID1' value='%Picker_Name_First_ID1%' size='20' class='sfm_textbox'/> </div> <div id='label11_container'> <label id='label11' for='Picker_Name_First_ID1' class='sfm_form_label'>Picker Name</label> </div> <div id='label12_container'> <label id='label12' for='Picker_Name_First_ID1' class='sfm_form_label'>Last</label> </div> <div id='label13_container'> <label id='label13' for='Picker_Name_First_ID1' class='sfm_form_label'>First</label> </div> <div id='label15_container'> <label id='label15' for='Actions_ID1' class='sfm_form_label'>Actions To Be Taken</label> </div> <div id='Actions_ID1_container'><textarea name='Actions_ID1' id='Actions_ID1' cols='50' rows='8' class='sfm_textarea'>%Actions_ID1%</textarea></div> <div id='label14_container'> <label id='label14' for='Comments_ID1' class='sfm_form_label'>Comments</label> </div> <div id='Comments_ID1_container'><textarea name='Comments_ID1' id='Comments_ID1' cols='50' rows='8' class='sfm_textarea'>%Comments_ID1%</textarea></div> <div class='element_label' id='Picker_Confirm_ID1_container'><input type='checkbox' name='Picker_Confirm_ID1' id='Picker_Confirm_ID1' value='Yes' %4e8c663c6495851abfac06ef48a73f85%/><label for='Picker_Confirm_ID1' class='element_label' id='Picker_Confirm_ID1_label'>Picker Confirm Action Is Done</label></div> <div id='Screen_Clipping_ID1_container'> <input type='file' name='Screen_Clipping_ID1' id='Screen_Clipping_ID1'/> </div> <div id='label16_container'> <label id='label16' class='sfm_form_label'>Upload Any Screen Clippings</label> </div> </tbody> Please help, Thanks! Hello im using this code to display a countdowntimer Code: <script type="text/javascript"> var timecd; timecd = document.getElementById('<%= Text1.ClientID %>').value; var GAME = ' | Hells Gate |'; var OpenTimeCOUNTER = ''; var TargetCOUNTER = document.getElementById('COUNTER'); var SecondsCOUNTER = timecd; var TargetTimeCOUNTER = new Date(); var TimeBeginnCOUNTER = TargetTimeCOUNTER.getTime(); var TimeEndCOUNTER = TimeBeginnCOUNTER + (SecondsCOUNTER * 1000); TargetTimeCOUNTER.setTime(TimeEndCOUNTER); var DayCOUNTER = TargetTimeCOUNTER.getDate(); var MonthCOUNTER = TargetTimeCOUNTER.getMonth() + 1; var YearCOUNTER = TargetTimeCOUNTER.getYear(); if (YearCOUNTER < 999) YearCOUNTER += 1900; var hCOUNTER = TargetTimeCOUNTER.getHours(); var mCOUNTER = TargetTimeCOUNTER.getMinutes(); var sCOUNTER = TargetTimeCOUNTER.getSeconds(); var fdayCOUNTER = ((DayCOUNTER < 10) ? "0" : ""); var fmonthCOUNTER = ((MonthCOUNTER < 10) ? ".0" : "."); var fhCOUNTER = ((hCOUNTER < 10) ? "0" : ""); var fmCOUNTER = ((mCOUNTER < 10) ? ":0" : ":"); var fsCOUNTER = ((sCOUNTER < 10) ? ":0" : ":"); var EndDateCOUNTER = fdayCOUNTER + DayCOUNTER + fmonthCOUNTER + MonthCOUNTER + "." + YearCOUNTER; var EndTimeCOUNTER = fhCOUNTER + hCOUNTER + fmCOUNTER + mCOUNTER + fsCOUNTER + sCOUNTER; var counterthing = window.setTimeout("CountDownCOUNTER()", 1000); function CountDownCOUNTER() { var CurrentDateCOUNTER = new Date(); var CurrentTimeCOUNTER = CurrentDateCOUNTER.getTime(); OpenTimeCOUNTER = Math.floor((TargetTimeCOUNTER - CurrentTimeCOUNTER) / 1000); var sCOUNTER = OpenTimeCOUNTER % 60; var mCOUNTER = ((OpenTimeCOUNTER - sCOUNTER) / 60) % 60; var hCOUNTER = ((OpenTimeCOUNTER - sCOUNTER - mCOUNTER * 60) / (60 * 60)); var fhCOUNTER = ((hCOUNTER < 10) ? "0" : ""); var fmCOUNTER = ((mCOUNTER < 10) ? ":0" : ":"); var fsCOUNTER = ((sCOUNTER < 10) ? ":0" : ":"); var TimeCOUNTER = fhCOUNTER + hCOUNTER + fmCOUNTER + mCOUNTER + fsCOUNTER + sCOUNTER; var OutputStringCOUNTER = TimeCOUNTER; if (OpenTimeCOUNTER <= 0) { OutputStringCOUNTER = '<a href="Default.aspx">Refresh<\/a>'; window.clearTimeout(counterthing); } TargetCOUNTER.innerHTML = OutputStringCOUNTER; document.title = (OutputStringCOUNTER.substring(0, 2) == "<a") ? "!!!READY!!!" : OutputStringCOUNTER + GAME; counterthing = window.setTimeout("CountDownCOUNTER()", 1000); } </script> When im debuging the project it shows ok without any problems: But when i host the website on the server i Get a NaN:NaN:NaN Don't know what is hapening... any help would be great Thanks Ricardo [Hi all! I am obviously new to Javascript, blah blah blah, etc ... Please help me by pointing out what is wrong with my code while changing as little as possible ... and if you could also please explain the part that says t = total( parseFloat(a,10), parseFloat(b,10), parseFloat(c,10), parseFloat(d,10)); if(!isNaN(t)) f.value = t; as I copied that portion from someone and I really don't understand it. Thank you soooo much!] <html> <head> <title>Problem 3</title> <style type="text/css"> body { background-color:blue; font-family:verdana; font-size:large; } input { width: 60px; } </style> <script type="text/javascript"> var f = (a*0.1)+(b*0.15)+(c*0.25)+(d*0.2)+(e*0.3) if ( grade5Obj.value.length < 1 ) alert("Please enter a grade in every box!"); else displayObj.value=ourText + nameObj.value + '!'; }; function update() var a = document.getElementById( 'grade1' ).value, b = document.getElementById( 'grade2' ).value, c = document.getElementById( 'grade3' ).value, d = document.getElementById( 'grade4' ).value, e = document.getElementById( 'grade5' ).value, f = document.getElementById( 'ans' ), t=0; t = total( parseFloat(a,10), parseFloat(b,10), parseFloat(c,10), parseFloat(d,10)); if(!isNaN(t)) f.value = t; </script> </head> <body> <form action="" method="post"> <p>Enter the first grade <input id="grade1" onkeyup="update()"><br> <p>Enter the second grade <input id="grade2" onkeyup="update()"><br> <p>Enter the third grade <input id="grade3" onkeyup="update()"><br> <p>Enter the fourth grade <input id="grade4" onkeyup="update()"><br> <p>Enter the fifth grade <input id="grade5" onkeyup="update()"><br> <p>Your final grade is <input name="finalGrade" readonly="true"> <input type="button" value="Click me!" onclick="finalGrade value=document.getElementById( 'ans' )"></p> </form> </body> </html> |