JavaScript - Ff Javascript Console Not Displaying Errors
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.
Similar TutorialsI would like to have a button just like for firebug, for error console, and that it would open error console window like for firebug. Is there a setting for that in FF, or some kind of addin outthere ?
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 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? Hi, i'm having problems with my console game, when i type in help when testing it just doesn't do anything, it's probarly a stupid mistake but i can't find what i did wrong :s index.html code Code: <html> <head> <script type="text/javascript" src="scripts/jquery.js"></script> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Console Game Project</title> </head> <body> <div id="console"> <p id="message_startgame">Welcome to Nieli's game! To control the game you must type in commands</p> <p id="area_northcorridor">You are in the north door. There is a sword on the ground.</p> <p id="message_help" style="display: none;">Here is a list of commands</p> <!-- PLACEHOLDER: THIS IS WHERE EVERYTHING WILL BE INSERTED BEFORE --> <div id="placeholder"></div> <form onsubmit="return false;"> <input type="text" size="50" autofocus="autofocus" id="command_line" /> </form> </div> <script type="text/javascript" src="scripts/game.js"></script> </body> </html> game.js code Code: //been to variables beentonorthdoor = true; // //Item variable sword = false; // //Current room currentroom = "n_corridor"; // $(document).ready(function() { $("form").submit(function() { var input = $("#command_line").val(); if (input == "help") { $("#message_help").clone().insertBefore("#placeholder").fadeIn(1000); } $("#command_line").val(""); }}; }}; I have on my website ( www.nieeli.com/game/ ) the index.html, then a folder scripts with jquery.js and game.js in.. Could anyone help me Oh, just noticed there is a Jquery help section... Sorry What can I do to find out what the errors in the error console mean?
Hello, Error Console tells me : exp is null Line 10 This does not make any sense to me. Could someone look at the short script below and tell me why I get this message? I know how to make this script work, but I just want to understand why function changePar cannot access the variable exp in the script below. Thank you very much. <code> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> Exercise 2</title> <meta http-equiv="content-type" content="text/html;charset=UTF-8" /> <script type="text/javascript"> exp=document.getElementById("experiment"); function changePar() { exp.getElementsByTagName("button")[0].onclick=function() { document.getElementById("changingParagraph").innerHTML="Hello World"; } } window.onload=changePar; </script> </head> <body> <div id="experiment"> <button>Click Here</button> </div> <p id="changingParagraph"></p> </body> </html> </code> 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. 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'm working with a javascript on a drupal website, but the saving function seems to work only as soon as i click 2 times on the "save" button. the code that fires the function is: Code: var param ="&usuario="+usuario+"&nivel="+nivel+gano+porc_gano+gasto+porc_gasto+tengo+porc_tengo+debo+ porc_debo+plazo_debo; var s = document.createElement("script"); s.type = "text/javascript"; s.async = true; s.src = server_direction +"setMisDatos?callback=respuestaGuardarMisDatos¶m="+encodeURIComponent(param); var h = document.getElementsByTagName("script")[0]; h.parentNode.insertBefore(s, h); //or h.appendChild(s); the chrome console tells me the error is in the last line i copied, but i don't undertand what kind of error it is. using chrome console (specifically the "network" one), i see that it's written in red, status/text "failed", type "undefined" size/content "13 B / 0 B"; when it works it's: status/text "200/OK", type "text/json", size/content "256 B/ 38B". i'm not an expert with this, is there some more information that could be useful? the code fires a netbeans function, that stores data to a postgresql database, so i have like 100 variables that has to be stored when i click on the "save button". Actually before i put parentNode.insertBefore, there used to be appendChild(s), but then i found out this algorithm from google analytics, which seems to be working better than the previous one. Having said that, i can tell you that the GET works after the first time i click perfectly, with some weird things happening, like if i browse another tab for a while, then go back to the page, and click on save, it won't work again (same error). The variables are written like this: Code: var plazo_debo_casa1 = (getValor("plazo_debo_casa1")); var plazo_debo_casa2 = (getValor("plazo_debo_casa2")); var plazo_debo_casa3 = (getValor("plazo_debo_casa3")); var plazo_debo_prestamo1 = (getValor("plazo_debo_prestamo1")); var plazo_debo_prestamo2 = (getValor("plazo_debo_prestamo2")); var plazo_debo_prestamo3 = (getValor("plazo_debo_prestamo3")); var plazo_debo ="&plazo_debo_casa1="+plazo_debo_casa1+"&plazo_debo_casa2="+plazo_debo_casa2+"&plazo_debo_casa3="+plazo_debo_casa3+"&plazo_debo_prestamo1="+plazo_debo_prestamo1+"&plazo_debo_prestamo2="+plazo_debo_prestamo2+"&plazo_debo_prestamo3="+plazo_debo_prestamo3; and then together in the "param" variable. Is it clearer now? i tried to copy document.head.appendChild(s); instead of parentNode.insertBefore(s,h), but it still behaves the same way. Still not any suggestions? This is part of the javascript file loading on my page, and since the function setMisDatos is in netbeans and it works correctly as soon as it's fired (at least, that's what i notice after the first click), i don't think it's worth copying part of it here, right? are there maybe too many variables for the GET method? is there a way to check GET errors? i'm sorry for not being an expert but i would really like some help here. I use console.log to print the dom element info, but some results make me very confused.The code is below, you can paste it to a file and browse it. //********************** <html> <head> </head> <body> <script type="text/javascript"> function showObjInPage(obj) { document.write("=======================================<br/>"); document.write((typeof obj) + "<br/>"); document.write("length: " + obj.length + "<br/>"); ///!!! 0, may ok document.write(obj); //!!!!!write nothing for (var prop in obj) { document.write(prop + " = " + obj[prop] + "<br/>"); } document.write("=======================================<br/>"); } function consoleLog(obj) { console.log("=======================================<br/>"); console.log((typeof obj) + "<br/>"); console.log("length: " + obj.length + "<br/>"); //!!!!! this is the confuse, it is 0, but the code below show obj correct! console.log(obj); //!!! write all the p elements for (var prop in obj) { console.log(prop + " = " + obj[prop] + "<br/>"); } console.log("=======================================<br/>"); } var elems = document.getElementsByTagName('p'); //console.log(elems); //console.log(elems.length); showObjInPage(elems); consoleLog(elems); </script> <p>p1</p> <p>p2</p> <p>p3</p> <p>p4</p> </body> </html> I want to print the p elements info use console.log, it is ok to log the elems, but the elems's length is 0, so it is not consistent! Maybe my code need to write after the 'p' element, but the problem is very confused. Is it a chrome console.log bug or just I do something wrong? 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? 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? 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. 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! 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. 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"> I have to display a div before firing a sync ajax in javascript div is getting displayed in firefox but not in IE and chrome. I need to basically display a download bar to indicate the user that the request is in progress Im coding a chat system, but the main thing which I cannot get working which is stopping me from doing this is displaying the data from the database. I have made a test XML document for the time being so that I can get the JavaScript/AJAX working properly, then I will figure out why my PHP isnt generating the XML file properly. Here is my XML document: Code: <?xml version="1.0" ?> <root> <message id="0"> <sender>martynball</sender> <receiver>someoneelse</receiver> <time>154375342</time> <text>Testing an XML document and seeing if the JavaScript will display it properly. If so then there is a problem with the PHP.</text> </message> </root> And here is my JavaScript/AJAX, for some reason there is NOTHING being displayed in the div which has the correct ID. Code: <script type="text/javascript"> function getXmlHttpRequestObject() { if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari return new XMLHttpRequest(); } if (window.ActiveXObject) { // code for IE6, IE5 return new ActiveXObject("Microsoft.XMLHTTP"); } return null; } //Make variables for later use var lastMess = 0; var sendReq = getXmlHttpRequestObject(); var receiveReq = getXmlHttpRequestObject(); var mTimer; function getMessage() { if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { //var url = "scripts/get_data.php?uid=<?=$_SESSION['uid']?>&m=" + lastMess + "&chat=1"; var url = "testXMLdoc.xml"; receiveReq.open("GET", url, true); receiveReq.onreadystatechange = manageMessage; receiveReq.send(null); lastMess++; } } function manageMessage() { if (receiveReq.readyState == 4) { var xmldoc = receiveReq.responseText; var chat_div = document.getElementById('chat'); var msg_nodes = xmldoc.getElementByTagName("message"); var n_msg = message_nodes.length; for (i = 0; i < n_msg; i++) { var sender_node = msg_node[i].getElementByTagName["sender"]; var receiver_node = msg_node[i].getElementByTagName["receiver"]; var time_node = msg_node[i].getElementByTagName["time"]; var text_node = msg_node[i].getElementByTagName["text"]; chat_div.innerHTML = "He <br />" + sender_node[0].firstChild.nodeValue + "<br />"; chat_div.innerHTML = reciever_node[0].firstChild.nodeValue + "<br />"; chat_div.innerHTML =time_node[0].firstChild.nodeValue + "<br />"; chat_div.innerHTML = text_node[0].firstChild.nodeValue + "<br />"; } } } </script> Also, I put a alert under the manageMessage() function before the IF statement and that gets displayed. Hi guys, I already posted this but it hasn't been approved by a mod or the mods are all at lunch or something lol. I want to display an image using javascript instead of HTML (or use javascript to change the HTML code dynamically when an update is made). I have created an XML file, which contains text data which is displayed in HTML by using Javascript. What I am having trouble with is getting Javascript to grab the image URL from the XML file, and then display that image in the correct div. How does one show an image by using javascript? and how do you get javascript to get the url from the XML? The following is my Javascript code which grabs the text from the XML and displays it in the HTML; Code: <script type="text/javascript"> var xmlDoc; <!-- if (window.XMLHttpRequest) { xhttp=new XMLHttpRequest(); } else // Internet Explorer 5/6 { xhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xhttp.open("GET","SDS.xml",false); xhttp.send(""); xmlDoc=xhttp.responseXML; var x=xmlDoc.getElementsByTagName("NEWS"); i=0; function display() { title=(x[i].getElementsByTagName("TITLE")[0].childNodes[0].nodeValue.fontsize("5").fontcolor("white").bold()); date=(x[i].getElementsByTagName("DATE")[0].childNodes[0].nodeValue.fontsize("2").fontcolor("white").bold()); stitle=(x[i].getElementsByTagName("STITLE")[0].childNodes[0].nodeValue.fontsize("3").fontcolor("white").italics()); story=(x[i].getElementsByTagName("STORY")[0].childNodes[0].nodeValue.fontsize("3").fontcolor("white")); txt= title + "<br />" + date + "<br />" + stitle + "<br />" + story; document.getElementById("show").innerHTML=txt; } //--> </script> And this is the XML file; Code: <?xml version="1.0" encoding="ISO-8859-1"?> <BULLETIN> <NEWS> <PIC>"newssmall.jpg"</PIC> <DATE>14/3/2010</DATE> <TITLE>News Story 1</TITLE> <STITLE>This is a short sentence to describe the story in brief</STITLE> <STORY>This is the text of the news story</STORY> </NEWS> </BULLETIN> So what I want to do is create a function that grabs the url (relative) from the PIC tag in the XML ("newssmall.jpg") and then uses this URL to display the image on the HTML page. This way, only the XML needs updating when updating the news section of the site. Thanks for helping if you can, Dan |