JavaScript - Do You Log Javascript Errors On Your Live Website?
Do you log JavaScript errors on your live website?
The actual errors that users experience? If you do, what tool do you use? And how is it woring out? If you don''t why not? Similar TutorialsHey I've created a new homepage for my cubecart shop, but when I upload it it doesn't display, I've check all resources and they are all being loaded Here is the site: http://www.genyx.co.uk/ Here is what it is supposed to look like: http://www.genyx.co.uk/Genyx%20Theme/html/index.htm Can anyone help? I want to run a piece of javascript on a live page that I don't have backend control of. I know it's possible. I've never done it before though. I'm in google chrome. This is what I see. I have no idea what I'm doing The validator showed up these errors on my site. They are from a script, but I know very limited javascript to correct it, to me it seems to be OK. 1. Line 15, Column 23: character "<" is the first character of a delimiter but occurred as data for (var i = 0; i < d.length; ++i) { This message may appear in several cases: * You tried to include the "<" character in your page: you should escape it as "<" * You used an unescaped ampersand "&": this may be valid in some contexts, but it is recommended to use "&", which is always safe. * Another possibility is that you forgot to close quotes in a previous tag. 2. Error Line 15, Column 23: StartTag: invalid element name for (var i = 0; i < d.length; ++i) { Code: <script type="text/javascript"> window.onload = function() { if (!NiftyCheck()) { return; } Rounded("div#nifty", "#666", "#FFF", 30, 30); } function adjustRadius() { d = getElementsBySelector("div.rounded"); for (var i = 0; i < d.length; ++i) { d[i].parentNode.removeChild(d[i]); } var x = document.getElementById("radiusx").value; var y = document.getElementById("radiusy").value; Rounded("div#nifty", "#666", "#FFF", x, y); return false; } </script> Does anyone know why these errors are coming up on the WC3? here is the link where the problem persist http://www.ornusweb.com/what_we_done.html I have mixed 2 scripts the light box script(lightbox.js) and scroller script(scriptaculous.js) the page only works with ie and in other browsers it opens as an image(light box wont work) the errors say 1st error> uncaught script.aculo.us requires the prototype javaScript frame work >1.4.0 scriptaculous.load (anonymous function) 2 error > uncaught typeErrorbject function object(){[native code]} has no method 'extends' (anonymous function) can some one help me solve these problem's Hello, I am having trouble with a javascript length converter that I got from http://www.javascriptkit.com/script/...onverter.shtml It is working fine in dreamweaver, but when it goes live on my site, the calculations do nothing. I can see everything in the drop down menus, but when i click the "to" button, nothing happens. I got the following errors from chrome when activating any of the calculation functions. I'm wondering if anyone here can help me decipher these 1. Uncaught TypeError: Cannot read property 'from_unit' of undefined 1. convert_unitDefault.aspx:459 2. (anonymous function)Default.aspx:482 3. onchangeDefault.aspx:483 1. Default.aspx:459Uncaught TypeError: Cannot read property 'from_unit' of undefined 1. convert_unitDefault.aspx:459 2. (anonymous function)Default.aspx:496 3. onchangeDefault.aspx:497 1. Default.aspx:459Uncaught TypeError: Cannot read property 'from_unit' of undefined 1. convert_unitDefault.aspx:459 2. (anonymous function)Default.aspx:516 3. onclickDefault.aspx:517 I have a loop that originally printed out a day, in a table, that linked to a new page. Code: out.println("<th height=100><a href=eventPage.jsp?month="+(n+1)+"&day="+d+">" + d + "</a>"); This works fine but now I want to instead have it be a link a page thats a pop up. The code I have now is as follows Code: out.println("<th height=100><a href="eventPage.jsp?month="+(n+1)+"&day="+d"" onclick="popUp(this.href);return false"> + d + "</a>">); and Code: <script type="text/javascript"> function popUp(URL) { <!-- window.open(URL,'width=300,height=300'); //--> } </script> I can not seem to find where I am going wrong. Any help would be appreciated. I would like to remove some hosting imposed google ads on my phpbb board. Currently I accomplish this by deleting via javascript all the banners divs when the page is loaded. But unfortunately in that way advertisements are quickly displayed before disappearing. Now I am thinking about a different (neater) approach to my problem: maybe I might write some javascript code which interferes with the one injected by google thus generating the inability to show those annoying divs... Any idea? I'm working with greasymonkey scripts. Firefox JS console would always display GM script errors, but all of the sudden it stopped doing that. Script just won't load and no errors are displayed. I didn't touch any settings, yesterday they were showing fine, today none are displayed. Would appreciate any help.
I have created a small file where I check if the passwords entered in the code match or not, if they do not match, the button that links to the next webpage should not work(allow them to go to the next wepage). ive tried various websites to help me try and solve this but I just dodont understand what they are doing. I'm very new to programming btw here is some example code: Code: !doctypeHTML <html> <script> //lets just pretend that ive already done all the .getelement by id stuff to get the code things //suppose the person did not write anything in the form, an error will get pushed(alerted basically) if(!form['password'].value) error.push('Missing Password'); <form> <label>Password<br><input type="password" name="password"></label> <label>Confirm Password<br><input type="password" name="confirm"</label> </form> </html> now how would I make the submit button not submit if there are errors? please be as simple as possible, I am new to this! I'm receiving the following errors: line 6 Expected an element name[xml] line 17 the input ended before all started tags were ended. last tag started was 'script'[xml] Code: <script type="text/javascript"> var camp = xfa.resolveNodes("camp[*]"); var total = 0; for (var i=0; i <= camp.length-1; i++) { if (camp.item(i).isNull) { total = total; } else { total = total + 30; } } this.rawValue = total; </script> I've got next to zero experience with javascript so not even sure what I should be looking to fix...any help is appreciated, if I need to answer something I missed, just let me know. For some reason i cant get this bit of code to work. You can ignore the php and html if its getting in your way. Thanks: Code: <div id="pl"> <? if($edit == true){ ?> <script type="text/javascript"> $("#add_playlist_form").css({display:"none"}); $("#add_playlist").click(function(){ alert($("#add_playlist").html()); if($("#add_playlist").html() == "Add a Playlist >>"){ $("#add_playlist").html("Hide <<"); $("#add_playlist_form").css({display:"block"}); } else{ $("#add_playlist").html("Add a Playlist >>"); $("#add_playlist_form").css({display:"none"}); } }); </script> <a href="#" id="add_playlist">Add a Playlist >></a> <form id="add_playlist_form" method="POST" action=" "> <input type="text" name="pl_name" class="add_playlist"/> <textarea name="pl_dsec" maxlength="200"></textarea> <input type="submit" name="submit_playlist" value="Add Playlist" class="submit_playlist"/> </form> <? } ?> <ul class="vList"> Validator (My CSE HTML Validator v9.0 ) reports javascript errors but program runs. There seems to be a problem with commands used twice and a missing semi-colon. Also there are problems with Firefox. Unable to reselect another image. OK with IE8. I would appreciate it if someone with better eyesight than me could give the jscript a once over for me. Thanks oin advance. Frank Culprit is here. EDITED. Hi guys, I want to add a big pic to my website for background, and the pic can change size with the displayer size. Can JavaScript do it? This is my website code. How can i make it? Thanks you! Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en"> <head> <title>Buy Cheap Jordans|Air Jordans Retro|Air force ones|Nike Dunks|gucci bags,bags wholesale</title> <link rel="icon" href="favicon.ico" mce_href="favicon.ico" type="image/x-icon"> <link rel="shortcut icon" href="favicon.ico" mce_href="favicon.ico" type="image/x-icon"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="keywords" content="nike air jordan shoes, zoom kobe shoes, nike dunk sb shoes, brand handbag" /> <meta name="description" content="Buy Cheap wholsale nike air jordan shoes, nike kobe shoes, dunk sb shoes, lv handbag, gucci shirts,online shop" /> <meta http-equiv="imagetoolbar" content="no" /> <base href="http://example.com/" /> <link rel="stylesheet" type="text/css" href="http://example.com/includes/templates/nike/css/stylesheet.css" /> <!--[if lte IE 6]><link rel="stylesheet" type="text/css" href="http://example.com/includes/templates/nike/css/stylesheet_ie6.css" /><![endif]--> <script type="text/javascript" src="includes/templates/template_default/jscript/jscript_imagehover.js"></script> <script type="text/javascript" src="includes/templates/template_default/jscript/jscript_index.js"></script> </head> <body id="indexHomeBody"> <div id="mainWrapper"> <script type="text/javascript"> function help_display_block(id){ if(document.getElementById(id).style.display=='block'){ document.getElementById(id).style.display='none'; }else{ document.getElementById(id).style.display='block'; } } function help_display_none(id){ document.getElementById(id).style.display='none'; } </script> <div style="position:relative;"> <div onclick="help_display_block('help_d')" style="position: absolute; width:236px; height:35px;left:744px;top:70px;+top:66px;_top:68px "><img src="images/livetop.gif"/></div> <div id="help_d" style="position: absolute; width:236px; height:174px;left:744px;top:103px; +top:102px;background:url(images/livechatbg.gif) no-repeat left top; padding:10px; display:none;"><br /> <div style=" padding-left:10px;" > <A href="msnim:chat?contact=cheapshoesbag@aol.com" target=blank><img src="images/chat.gif" width="194" height="61" /></A><br /> <br /> <div style="padding-bottom:5px; font-weight:bolder"> E_mail:</div> <a href="mailto:cheapshoesbag@aol.com">cheapshoesbag@aol.com</a> <div style="padding-bottom:5px; font-weight:bolder"> MSN:</div> cheapshoesbag@hotmail.com</div> <div class="live_close" style="float:right; padding-right:20px" onclick="help_display_none('help_d')" ><img src="images/close.gif"/></div> </div> </div> <div id='key_wholesale'> Welcome! <a href="http://example.com/index.php?main_page=login">Log In</a> or <a href="http://example.com/index.php?main_page=create_account">Register</a> <!-- AddThis Button BEGIN --> <script type="text/JavaScript"> <!-- function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0; } //--> </script> </div> <!--bof-header logo and navigation display--> <div class="wrap"> <a href="http://example.com/" id="hohologo" title="Welcome to our site!"> </a> <div> <h1 id="top_ueserinfo">nike air jordan shoes, zoom kobe shoes!</h1> <div id="toptab"> <ul> <li><a href="http://example.com/index.php?main_page=account" id="myAccount" class="hide" rel=nofollow><span>My Account</span></a> <!--[if lte IE 6]> <a href="#" id="myAccount"><span>My Account</span> <table><tr><td> <![endif]--> Hey all, I need help creating a Javascript loop which posts a single static comment to all videos on a website(unless another language would prove to be a better alternative?) I'm not sure where to start and although I have an idea, my lack of programming skills have left me to turn to forums...any help would be greatly appreciated. *not asking for coding necessarily. Links to relative information pertaining to such a program/"loop", and any comments helping me understand what I'm trying to do would be great...I'm just not sure what to search for lol. Im still learning, just need helping starting a project. Thanks. Hello, I am developing a website using HTML, CSS and JavaScript. Actually, I used Javascript a lot in that website and I am developing it in Internet Explorer Environment but I want to display it on the Firefox or Google Chrome but the problem is some of javascript codes do not work in these browsers. So what Should I do? I think I need to define the javascript for the different browsers, so how can I do that? Quote: Originally Posted by bullant I'm glad you have finally come round to my and other peoples' way of thinking because in the past when I have suggested users do something server side to avoid a plan B for javascript disabled browsers you reply saying javascript is disabled in only a tiny minority of browsers and that your position is that javascript is a "must have" for web functionality nowadays (or words to that effect). In fact I quite often agree with you - although not necessarly without qualification. Your expertise as a coder is plain to see. But you often see fit to express yourself in a disagreeable, quarrelsome, snide, supercilious, self-satisfied and generally unpleasant manner, so your comments do not generate the respect they might otherwise deserve. You seem to delight in going out of your way to create friction and antagonism. As I have said before, you are not liked, so you are not respected, and as you are not respected your postings and opinions are not seen as valuable. The reason why it might well be better to do something server-side is not, in my opinion, anything to do with Javascript-disabled browsers. It is simply which method is most efficient and secure. In this situation you are right to say that server-side is to be preferred. But Javascript is much more than "bells and whistles" and these days is completely essential, not optional, for web functionality. As VIP Stephan has pointed out, the OP said "I didn't write this script and I'm not a JavaScript expert, so I don't know how to edit it properly. I want to change it's function from sorting to filtering, i.e. something along the lines of a slice function. " So there is no point in whickering on about your preference for server-side scripting. You might as well suggest that the OP writes it in Klingon. Hi all - I'm designing a website, and I need to have a search button allow users to search the inventory that is on the website. I'm not quite sure what code I'm going to use for the search button, but I imagine that I can work on that sometime.. Along with the code, am I required to have something such as a MySQL database set-up or something of the sort? This question may be mis-categorized, so please let me know if it is. Thanks everyone! Hello all, My website has a search field at the index page. I want to test this search field for vulnerabilities by entering Javascript. When i enter <script>alert("test");</script> in the search field there comes a pop-up which says: "best" instead of "test". When I enter <script>alert("test123");</script> the pop-up says: "test" instead of "test123" The page source displays the following after I enter <script>alert("test");</script> in the search field. As you can see it changes my "test" input to "best" for some kind of reason. <a href="/searchresults.jsp?searchpage=1&freetext=%3Cscript%3Ealert%28%22best%22%29%3B%3C%2Fscript%3E& pagepart=objectname;description;shorturl&expressionset=&nodelocation=0000000000010000&ds mshowinsearch=true&dateformat=dd-MM-yyyy&creationdatestart=&creationdateend=&modificationdatestart=&modificationdateend= &publicationdatestart=&publicationdateend=&searchbase=0&searchrange=10&expans ion =" class="blauw bold italic"><script>alert(" best ");</script></a> <a href="/searchresults.jsp?searchpage=2&freetext=%3Cscript%3Evoert%28%22test%22%29%3B%3C%2Fscript%3E& pagepart=objectname;description;shorturl&expressionset=&nodelocation=0000000000010000&ds mshowinsearch=true&dateformat=dd-MM-yyyy&creationdatestart=&creationdateend=&modificationdatestart=&modificationdateend= &publicationdatestart=&publicationdateend=&searchbase=0&searchrange=10&expans ion =" class="blauw bold italic"><script>voert(" test ");</script></a> <a href="/searchresults.jsp?searchpage=3&freetext=%3Cscriptie%3Ealert%28%22test%22%29%3B%3C%2Fscriptie%3E& amp;pagepart=objectname;description;shorturl&expressionset=&nodelocation=0000000000010000&am p;dsmshowinsearch=true&dateformat=dd-MM-yyyy&creationdatestart=&creationdateend=&modificationdatestart=&modificationdateend= &publicationdatestart=&publicationdateend=&searchbase=0&searchrange=10&expans ion =" class="blauw bold italic"><scriptie>alert(" test ");</scriptie></a> </p> <p class="sorteer-aantal">Deze zoekvraag levert geen resultaten op</p> So in some way my website changes my input, but what is happening? and is it possible that somebody can abuse this searchfield? Thanks in advance for your reply, Hanna (a newbie with Javascript) Hey there, so this is my first time using this website. I was wondering if anyone can help me resolve this problem. It is for my Website Development Class and I am going use this forum to help me understand the languages haha. But Anyways. My homework assignment I have to do is: Create a Web page named gpa.html that can be used to compute your grade point average given grades and hours for courses completed. The page should repeatedly prompt the user for course information, reading the course name, grade received, and credit hours for a particular course in a single dialog box. While the user is done inputting the information, it should display on the website like this: COURSE GRADE HOURS THL100 B+ 3 PHL107 A 3 ENG120 C+ 3 MTH245 A 4 CSC221 A 3 Total grade points = 58 Number of hours = 16 GPA = 3.625 So my problem is that when I tried to display it outside the while loop it only displays "NaN". Please Help and Thanks! Here is my code: <!DOCTYPE html> <html> <!-- gpa.html--> <head> </head> <body> <script type= "text/javascript"> document.write("Course - Grade - Credit Hours"); document.write("<br>"); var third; var total = 0; var total2 = 0; var total4 = 0; var t_hrs = 0; var user; while (user != "") { user = prompt("Hello User. Enter course name, grade, & credit hours (i.e CS3240 B+ 3), or click OK with no data to terminate."); var uInput = user.split(" "); document.write(uInput); document.write("<br>"); third = uInput[2]; t_hrs = parseInt(t_hrs) + parseInt(uInput[2]); if (uInput[1] == "A"){ letter2point = 4.0; } else if (uInput[1] == "B+"){ letter2point = 3.5; } else if (uInput[1] == "B"){ letter2point = 3.0;} else if (uInput[1] == "C+"){ letter2point = 2.5; } else if (uInput[1] == "C"){ letter2point = 2.0; } else if (uInput[1] == "D"){ letter2point = 1.0; } else if (uInput[1] == "F"){ letter2point = 0.0; } total = letter2point * third; total2 = total2 + total; total4 = total2 / t_hrs; } document.write(total4) </script> </body> </html> Reply With Quote 01-29-2015, 02:47 AM #2 felgall View Profile View Forum Posts Visit Homepage Master Coder Join Date Sep 2005 Location Sydney, Australia Posts 6,745 Thanks 0 Thanked 666 Times in 655 Posts If that antiquated JavaScript is what your course is teaching then I feel sorry for you. Just about every statement that you have there is listed on one of the "Bad Bits" pages of my Introducing JavaScript web site where it gives the reasons for not using those 20 year old code constructs in modern web browsers (which means IE5 and any browser more recent than that). A couple of suggestions to get you started. 1. The second document.write is not complete so everything from there onward is broken. 2. To convert to a number use Number((t_hrs) or (+t_hrs). If you must use parseint then always include the second parameter to specify the number base you are converting from parseInt(t_hrs, 10) - with regard to t_hrs it is a number to start with so doesn't even need this conversion. 3. Use === and !== instead of == and != as the two character versions don't always give the expected result where the three character versions always do. |