JavaScript - Invalid Augment Error
I have a resized textbox. When the textbox gets resized less that 0px I get an Invalid Augment error. How can I trap that error?
function DecreaseSize(){ var ta.style.height = $get('<%=myTextbox.ClientID %>'); ta.style.height = (parseInt(ta.style.height) - 23) + "px"); } Similar TutorialsHi, So I'm testing my webpage in IE8. In firefox it looks and runs greag, but in IE 8, one issue I'm having is this: I have a button that opens a popup window. Works fine in Firefox, but I get 'invalid argument' error in IE8 and the window does not open. I've enabled at a whim some scripting things in the Internet Options hoping that would resolve the issue, but not so. Here's the code. The "invalid argument" occurs on the window.open call. Code: function open_report() { createURL(); var report_vars = created_URL; report_vars = report_vars.substr(69); report_array = report_vars.split('='); var from_d = report_array[2].substr(0,10); var to_d = report_array[3].substr(0,10); window.open('detailedreport.shtml' + report_vars, 'My Site | Detailed Report - ' + from_d + ' to ' + to_d, 'title=yes, status=no, toolbar=no, location=no, menubar=no, scrollbars=yes, modal=yes, alwaysRaised=yes, width=' + window.outerWidth / 1.1 + ', height=' + window.outerHeight); } In addition, is there any way to have that tile I've given it, "my Site..." appear in the window header? Right now it's not appearing at all in either browser. Thanks for reading! Hi, I have written a function to compare each character in startString with another nominated character (nomChar). If they are the same this character is written to outputString, in the same position. If they are not the same a character is lifted from the same position in altString and placed in the same position in outputString instead. I hope that's clear! Code as follows: Code: function compareChar(startString, altString, nomChar) { var outputString = ''; outputString.length = startString.length; var nextLetter = ''; for (var count = 0; count < startString.length; count = count + 1) { nextLetter = startString.charAt(count); if (nextLetter == nomChar) { outputString.charAt(count) = nextLetter; } else { outputString.charAt(count) = altString.charAt(count); } } } document.write(compareChar('boston', 'denver' , 'o' ) ); However, the line of code within the if statement Code: outputString.charAt(count) = nextLetter; keeps generating an 'Invalid assigment left hand side' error message. Can anyone see why this is the case? Thanks. The suspect line is the following $('.leaveClan').attr('id') = <?php echo $id; ?>; the span with the class (there is only one) leaveClan is on the main page, and that line of javascript is on a page being called by AJAX within that page. Can anyone see why that is causing an error? Let me know if you need to see any more of the code I'm trying to get some basic javascript down so I can have my text come in from both the top and the bottom of the screen when the page loads. It's working just fine in Firefox, but in IE it stops with an "invalid argument" error. The problem comes on this line: Code: document.getElementById('part1').style.top = down[part1Position] + "px"; Here's the whole code in my separate .js file. Code: var part1Position = 0; var part2Position = 0; var downPosition = -19; var upPosition = 800; var down = new Array(); var up = new Array(); for(var i = 0; i < 91; ++i) { down[i] = downPosition; downPosition += 3; } for(var x = 0; x < 184; ++x) { up[x] = upPosition; upPosition -= 3; } function part1Move(){ document.getElementById('part1').style.top = down[part1Position] + "px"; ++part1Position; /*if (part1Position == 79) part1Position = 79;*/ } function part2Move() { document.getElementById('part2').style.top = up[part2Position] + "px"; ++part2Position; /*if (part2Position == 83) part2Position = 83;*/ } function startMoving() { setInterval("part1Move()",1); setInterval("part2Move()",1); } Any help would be greatly appreciated! I'm stumped. I'm trying to figure out why this doesnt work and how it will... The current script is as follows: Code: <script type="text/javascript"> function ReturnValueFromPopup(returnValue) { var imageURL = returnValue; } function SimpleTextEditor(id, objectId) { if (!id || !objectId) { alert("SimpleTextEditor.constructor(id, objectId) failed, two arguments are required"); } var self = this; this.id = id; this.objectId = objectId; this.frame; this.viewSource = false; this.path = ""; // with slash at the end this.cssFile = ""; this.charset = "iso-8859-1"; this.editorHtml = ""; this.frameHtml = ""; this.textareaValue = ""; this.browser = { "ie": Boolean(document.body.currentStyle), "gecko" : (navigator.userAgent.toLowerCase().indexOf("gecko") != -1) }; this.init = function() { if (document.getElementById && document.createElement && document.designMode && (this.browser.ie || this.browser.gecko)) { // EDITOR if (!document.getElementById(this.id)) { alert("SimpleTextEditor "+this.objectId+".init() failed, element '"+this.id+"' does not exist"); return; } this.textareaValue = document.getElementById(this.id).value; var ste = document.createElement("div"); document.getElementById(this.id).parentNode.replaceChild(ste, document.getElementById(this.id)); ste.id = this.id+"-ste"; ste.innerHTML = this.editorHtml ? this.editorHtml : this.getEditorHtml(); // FRAME if (this.browser.ie) { this.frame = frames[this.id+"-frame"]; } else if (this.browser.gecko) { this.frame = document.getElementById(this.id+"-frame").contentWindow; } this.frame.document.designMode = "on"; this.frame.document.open(); this.frame.document.write(this.frameHtml ? this.frameHtml : this.getFrameHtml()); this.frame.document.close(); insertHtmlFromTextarea(); } }; function lockUrls(s) { if (self.browser.gecko) { return s; } return s.replace(/href=["']([^"']*)["']/g, 'href="simpletexteditor://simpletexteditor/$1"'); } function unlockUrls(s) { if (self.browser.gecko) { return s; } return s.replace(/href=["']simpletexteditor:\/\/simpletexteditor\/([^"']*)["']/g, 'href="$1"'); } function insertHtmlFromTextarea() { try { self.frame.document.body.innerHTML = lockUrls(self.textareaValue); } catch (e) { setTimeout(insertHtmlFromTextarea, 10); } } this.getEditorHtml = function() { var html = ""; html += '<iframe id="'+this.id+'-frame" frameborder="0"></iframe>'; return html; }; this.getFrameHtml = function() { var html = ""; html += '<html><head></head><body></body></html>'; return html; }; this.execCommand = function(cmd, value) { if (cmd == "insertimage" && !value) { //var imageUrl = prompt("Enter Image URL:", ""); window.displayWindow(); } else if(cmd == "imageURL" && value){ alert(value); this.frame.focus(); this.frame.document.execCommand(cmd, false, value); this.frame.focus(); } }; this.isOn = function() { return Boolean(this.frame); }; this.getContent = function() { try { return unlockUrls(this.frame.document.body.innerHTML); } catch(e) { alert("SimpleTextEditor "+this.objectId+".getContent() failed"); } }; this.submit = function() { if (this.isOn()) { if (this.viewSource) { this.toggleSource(); } document.getElementById(this.id).value = this.getContent(); } }; } </script> <textarea id="myfield" name="myfield" style="font-family:Arial;font-size:12px;"></textarea> <script type="text/javascript"> var ste = new SimpleTextEditor("myfield", "ste"); ste.init(); </script> <script type="text/javascript"> function insertimage(){ var imgURL = document.getElementById('imageurl').value; ste.execCommand("imageURL", imgURL); } function CallWindowOpener(returnValue){ if (typeof ReturnValueFromPopup == 'function'){ ReturnValueFromPopup(returnValue); } } </script> <input name="imageurl" id="imageurl" type="text" /> <input name="Submit" type="button" onClick="insertimage();" value="Submit Image Url"/> When inserting anything into the imageurl textbox in the bottom of the script and submitting it I get an invalid argument error regarding to this line: this.frame.document.execCommand(cmd, false, value); within the: else if(cmd == "imageURL" && value){ In the end of the first javascript... Can anybody tell me how to get passed this please... Thanks in advance ;-) Code: function get_dims() { winH = getH(); winW = getW(); //alert(document.body.offsetHeight); document.getElementById('bgimg').width = winW; document.getElementById('bgimg').height = winH; document.getElementById('bgimgwrap').width = winW; document.getElementById('bgimgwrap').height = winH; var h = document.getElementById('header').offsetHeight; document.getElementById('layerimg').width = winW; document.getElementById('layerimg').height = (winH-h); document.getElementById('layerimg').style.top = h+"px"; document.getElementById('page').style.top = (document.getElementById('page').offsetTop + h)+"px"; document.getElementById('main').style.width = (winW*7)+"px"; document.getElementById('child').style.top = winH+"px"; document.getElementById('child').height = (winH-h)+"px"; var td = document.getElementsByTagName('td'); for(i = 0; i < td.length; i++) { td[i].width = winW+"px"; td[i].height = (winH-h)+"px"; \\this is the line with the error i have tried all sorts of different things with it to no avail } } function getH() { if (parseInt(navigator.appVersion)>3) { if (navigator.appName=="Netscape") { winH = window.innerHeight; } if (navigator.appName.indexOf("Microsoft")!=-1) { winH = document.body.offsetHeight; } } return winH; } function getW() { if (parseInt(navigator.appVersion)>3) { if (navigator.appName=="Netscape") { winW = window.innerWidth; } if (navigator.appName.indexOf("Microsoft")!=-1) { winW = document.body.offsetWidth; } } return winW; } I am using a jQuery slider on a website but the code comes up with invalid, is there any wat to get around this without using a div tag? Thanks for any help on this: Line 26, Column 27: document type does not allow element "div" here .before('<div id="buttons">') Code: <script type="text/javascript"> $(document).ready(function() { $('#slider') .before('<div id="buttons">') .cycle({ fx: 'fade', pager: '#buttons' }); }); </script> I am wanting all the inputs of the table cells turn red when invalid data (in this case anything other than a number) is entered. Object: 1. To add a className to those inputs 2. With the new className 'invalid" the CSS gives a red background to the input The appending of the className is not showing up in the generated source code and both Firefox and Chrome is not showing any errors in the code. I can't not figure out what is preventing the execution. Any advise to this simple problem will greatly be appreciated. Code: if (document.getElementsByTagName && document.getElementById) { var dg = { // references to the table table : document.getElementsByTagName('table')[0], tbody : document.getElementById('data').tBodies[0], //reference to the inputs dataInput : document.getElementsByTagName('input'), init : function() { // configure event listening and delegation this.util.configEvents(); // assign listeners to the table this.util.addEvent(this.table, 'keyup', this.checkData, true); }, checkData : function(dataInput) { // if it is not a number, mark the input as invalid if (isNaN(dataInput.value)) { dg.dataInput.className = 'invalid'; } // if the user deleted the value entirely, remove any invalid indication else if (dataInput.value === '') { dg.dataInput.className = ''; } }, util : { configEvents : function() { if (document.addEventListener) { this.addEvent = function(el, type, func, capture) { el.addEventListener(type, func, capture); }; this.stopBubble = function(evt) { evt.stopPropagation(); }; this.stopDefault = function(evt) { evt.preventDefault(); }; this.findTarget = function(evt, targetNode, container) { var currentNode = evt.target; while (currentNode && currentNode !== container) { if (currentNode.nodeName.toLowerCase() === targetNode) { return currentNode; break; } else { currentNode = currentNode.parentNode; } }; return false; }; } else if (document.attachEvent) { this.addEvent = function(el, type, func) { el["e" + type + func] = func; el[type + func] = function() { el["e" + type + func] (window.event); }; el.attachEvent("on" + type, el[type + func]); }; this.stopBubble = function(evt) { evt.cancelBubble = true; }; this.stopDefault = function(evt) { evt.returnValue = false; }; this.findTarget = function(evt, targetNode, container) { var currentNode = evt.srcElement; while (currentNode && currentNode !== container) { if (currentNode.nodeName.toLowerCase() === targetNode) { return currentNode; break; } else { currentNode = currentNode.parentNode; } }; return false; }; } } } }; dg.init(); } I wrote a form and a JavaScript to valid the form. I cannot figure out however how to stop the form from submitting if the form is invalid. [CODE] function validateForm() { if(""==document.test.custName.value) { alert("Please enter your name."); return false; } if(""==document.test.email.value) { alert("Please enter your email address."); return false; } if(""==document.test.custComment.value) { alert("Please enter your comment."); return false; } return true; } [CODE] I added this "show hint" script to my website. I submitted the URL in W3C's HTML validator. It says that XHTML doesn't support onMouseover, so I changed it to all lowercase: onmouseover. When I refreshed the page, the little error warning showed up in my lower left corner. The JavaScript seemed to not be working because I changed it from onMouseover to onmouseover. Help? Code: <script type="text/javascript"> var horizontal_offset="9px" //horizontal offset of hint box from anchor link /////No further editting needed var vertical_offset="0" //horizontal offset of hint box from anchor link. No need to change. var ie=document.all var ns6=document.getElementById&&!document.all function getposOffset(what, offsettype){ var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop; var parentEl=what.offsetParent; while (parentEl!=null){ totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop; parentEl=parentEl.offsetParent; } return totaloffset; } function iecompattest(){ return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body } function clearbrowseredge(obj, whichedge){ var edgeoffset=(whichedge=="rightedge")? parseInt(horizontal_offset)*-1 : parseInt(vertical_offset)*-1 if (whichedge=="rightedge"){ var windowedge=ie && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-30 : window.pageXOffset+window.innerWidth-40 dropmenuobj.contentmeasure=dropmenuobj.offsetWidth if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure) edgeoffset=dropmenuobj.contentmeasure+obj.offsetWidth+parseInt(horizontal_offset) } else{ var windowedge=ie && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18 dropmenuobj.contentmeasure=dropmenuobj.offsetHeight if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure) edgeoffset=dropmenuobj.contentmeasure-obj.offsetHeight } return edgeoffset } function showhint(menucontents, obj, e, tipwidth){ if ((ie||ns6) && document.getElementById("hintbox")){ dropmenuobj=document.getElementById("hintbox") dropmenuobj.innerHTML=menucontents dropmenuobj.style.left=dropmenuobj.style.top=-500 if (tipwidth!=""){ dropmenuobj.widthobj=dropmenuobj.style dropmenuobj.widthobj.width=tipwidth } dropmenuobj.x=getposOffset(obj, "left") dropmenuobj.y=getposOffset(obj, "top") dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+obj.offsetWidth+"px" dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+"px" dropmenuobj.style.visibility="visible" obj.onmouseout=hidetip } } function hidetip(e){ dropmenuobj.style.visibility="hidden" dropmenuobj.style.left="-500px" } function createhintbox(){ var divblock=document.createElement("div") divblock.setAttribute("id", "hintbox") document.body.appendChild(divblock) } if (window.addEventListener) window.addEventListener("load", createhintbox, false) else if (window.attachEvent) window.attachEvent("onload", createhintbox) else if (document.getElementById) window.onload=createhintbox </script> Code: <a href="#" class="hintanchor" onmouseover="showhint('Display hint here.', this, event, '150px')"><img src="/images/help.gif" alt=""/></a> (just started JS 2 weeks ago) -- this is also my first time posting here, if my post isnt following the proper template let me know and Ill fix it .. Thanks so much for taking the time to check this out in advance Im trying to make the first ul tag in the each slideMenus[] array index values have a position of left = 0px I keep recieving this error however ____________________________________________________ Error: slideMenus[i].getElementsByTagName("ul").style is undefined Line: 63 ------------------------------------------------------------------ the script in question is in [code]. Could someone tell me if I am just making a syntax error if not ill try redoing the whole thing. window.onload = makeMenus var currentSlide = null var timeID = null leftPos = 0 function makeMenus(){ var slideMenus = new Array() var allElems = document.getElementsByTagName("*") var slideListArr = new Array() for(var i=0 ; i < allElems.length ; i++){ if(allElems[i].className = "slideMenu") slideMenus.push(allElems[i]) } for(var i=0 ; i < slideMenus.length ; i++){ slideMenus[i].onclick = showSlide; Code: slideMenus[i].getElementsByTagName("ul")[0].style.left = "0px"; } document.getElementById("head").onClick = closeSlide document.getElementById("main").onClick = closeSlide } function showSlide(){ var slideList = this.getElementsByTagName("ul")[0] // mess with this if((currentSlide != null) && (currentSlide.id == slideList.id)) {closeSlide()} else{ closeSlide(); var currentSlide = slideList; currentSlide.style.display = "block"; timeID = setInterval('moveSlide()', 1); } } function closeSlide(){ if(currentSlide){ clearInterval(timeID); currentSlide.style.left = "0px" currentSlide.style.display = "none"; var currentSlide = null } } function moveSlide(){ var leftPos = leftPos + 5; if(leftPos <= 220) {currentSlide.style.left = leftPos + "px"} else{ clearInterval(timeID); var leftPos = 0} } Strange problem here... I'm implementing google's JS tracking code verbatim which determines whether or not the current site is using HTTP or HTTPS. It builds a dynamic URL used as the "SRC" parameter in the SCRIPT statement. On browsers I'm testing with(FF, IE, Chrome) there's no problem running the code. However, there are some people in the office who get an FF or IE error (same versions as mine) on the URL as the SRC parameter. The error, in the FF Error Console, is this: Quote: illegal character http://www.google-analytics.com/ga.js ? ? ? ? --> question marks appear in console I can't figure it out since I can't create this error on any of my browsers. Could this be related to something like browser security settings or add-ons? So i keep getting this nan error. I googled the crap out of it but can't find anything that works. This part here works fine: Code: function calBolt() { boltQTY = document.getElementById("boltQTY").value; boltCost=boltQTY * 2.1; boltCost=boltCost.toFixed(2); if (boltCost == 0) { document.getElementById("test").lastChild.nodeValue = "$0.00"; } else { document.getElementById("test").lastChild.nodeValue = "$"+boltCost; } } But when i try to use those variables in this function i keep getting an NAN error. Code: function total(boltCost,nutCost,washCost) { var total= 0; total = parseFloat(boltCost)+parseFloat(nutCost)+parseFloat(washCost); document.getElementById("content").lastChild.nodeValue= total; } At the moment i'm trying to use parsefloat to convert it. No luck. I'm thinking it's something really basic and obvious...i do that a lot. am working on a certain project , and there is a part were i have to upload a photo; when i run that part of the code am getting the following error message "The value for the useBean class attribute javazoom.upload.UploadBean is invalid" here is the part of the code <%@ page language="java" import="javazoom.upload.UploadBean*,java.util.*,java.io.*" %> <%@ page language="java" import="javazoom.upload.UploadBean*,java.util.*,java.io.*" %> <%@ page errorPage="ExceptionHandler.jsp" %> <jsp:useBean id="upBean" scope="page" class="javazoom.upload.UploadBean" > <jsp:setProperty name="upBean" property="folderstore" value="<%= directory %>" /> <jsp:setProperty name="upBean" property="parser" value="<%= MultipartFormDataRequest.CFUPARSER %>"/> <jsp:setProperty name="upBean" property="parsertmpdir" value="<%= tmpdirectory %>"/> <jsp:setProperty name="upBean" property="filesizelimit" value="8589934592"/> <jsp:setProperty name="upBean" property="overwrite" value="<%= allowoverwrite %>"/> <jsp:setProperty name="upBean" property="dump" value="true"/> </jsp:useBean> PLEASE HELP!!!!! Hello I am getting an error message on a page that uses Javascript. The error is as follows: Code: Message: 'Class' is undefined Line: 1 Char: 1 Code: 0 URI: http://stevehigham59.7host.com/final...//imageMenu.js The first line in the JS file is: var ImageMenu = new Class({ How could I resolve this error, please? Thanks. Steve Why is there a syntax error in this and how do i fix? Code: $(document).ready(function() { $("#gogo").click(function() { $("#replace").html(" <tr> <td width='800' height='186' align='left' valign='top' class='end'> <h1><a href='register.php'><br /> </a></h1> <h1>About Chef Match</h1> <p class='txt' id='more'>Chef Match is a revolutionary site which creates the link between staff and tempory work. Remember this site is not only aimed at chefs, but at anyone who works in a catering environment, waiters, bar staff and even kitchen porters.</p> <p class='txt'> </p> <p class='txt'>Chef Match is a revolutionary site which creates the link between staff and temporary work. Remember this site is not only aimed at chefs, but at anyone who works in a catering environment, waiters, bar staff and even kitchen porters.</p> <p><span class='txt'>Chef Match is a revolutionary site which creates the link between staff and tempory work. Remember this site is not only aimed at chefs, but at anyone who works in a catering environment, waiters, bar staff and even kitchen porters.</span></p> <p><span class='txt'>Chef Match is a revolutionary site which creates the link between staff and tempory work. Remember this site is not only aimed at chefs, but at anyone who works in a catering environment, waiters, bar staff and even kitchen porters.</span></p> <p><span class='txt'>Chef Match is a revolutionary site which creates the link between staff and tempory work. Remember this site is not only aimed at chefs, but at anyone who works in a catering environment, waiters, bar staff and even kitchen porters.</span></p> <p><span class='txt'>Chef Match is a revolutionary site which creates the link between staff and tempory work. Remember this site is not only aimed at chefs, but at anyone who works in a catering environment, waiters, bar staff and even kitchen porters.</span></p> <p><span class='txt'>Chef Match is a revolutionary site which creates the link between staff and tempory work. Remember this site is not only aimed at chefs, but at anyone who works in a catering environment, waiters, bar staff and even kitchen porters.</span></p> <p><span class='txt'>Chef Match is a revolutionary site which creates the link between staff and tempory work. Remember this site is not only aimed at chefs, but at anyone who works in a catering environment, waiters, bar staff and even kitchen porters.</span></p> <p><span class='txt'>Chef Match is a revolutionary site which creates the link between staff and tempory work. Remember this site is not only aimed at chefs, but at anyone who works in a catering environment, waiters, bar staff and even kitchen porters.</span></p> <p><span class='txt'>Chef Match is a revolutionary site which creates the link between staff and tempory work. Remember this site is not only aimed at chefs, but at anyone who works in a catering environment, waiters, bar staff and even kitchen porters.</span></p> <p><span class='txt'>Chef Match is a revolutionary site which creates the link between staff and tempory work. Remember this site is not only aimed at chefs, but at anyone who works in a catering environment, waiters, bar staff and even kitchen porters.</span></p> <p><span class='txt'>Chef Match is a revolutionary site which creates the link between staff and tempory work. Remember this site is not only aimed at chefs, but at anyone who works in a catering environment, waiters, bar staff and even kitchen porters.</span></p> <p><span class='txt'>Chef Match is a revolutionary site which creates the link between staff and tempory work. Remember this site is not only aimed at chefs, but at anyone who works in a catering environment, waiters, bar staff and even kitchen porters.</span></p> <p> </p></td> </tr> "); }); }); Hi guys! My first post here! I was encountering a rather confusing error using the webinterface of the DVBViewer Recording Service. Unfortunately the author of this software passed away more than a year ago, so nobody at the forum have the skills to solve this bug. The webinterface has a timeline view of a TV EPG. There are two buttons that navigates back and forth in EPG time. The upcoming DST change on sunday 26th October has revealed a bug. There is no way to navigate passed sunday with the button. Pressing repatedly on the button trying to get mondays EPG. sundays EPG reloads after each button press. Its stuck so to say. I therefor wonder if anyone in here would feel like helping out? The current Recording Service developer pinpointed the error here in the timeline.js: Code: Line 42: var ONE_DAY = 24*60*60*1000; Line 686: /** * increments or decrements the date in the datepicker by the given amount */ function moveDate(offset) { var currDate = datefield.datepicker("getDate"); currDate.setTime(currDate.getTime() + offset * ONE_DAY); var now = new Date().getTime(); if (currDate.getTime() + 2*ONE_DAY < now || currDate.getTime() - 31*ONE_DAY > now) { return; } datefield.datepicker("setDate", currDate); guiactionform.submit(); } Line 1298: $('#nextday').click(function() { moveDate(+1); }); Unfortunately the timeline.js is too large to post in code box so i try to append it as a file: timeline.zip Best regards majstang SOLUTION: I accidentally used <\ul> instead of </ul> ... IE actually threw a proper error, since \u escapes a unicode string (in hex) --- I have the following section of javascript: Code: jQuery.each($('.prodContent'), function(i, val) { if(!($(this).is(":has(ul.tabs)"))) { jQuery.each($(this).children('.panes:has(.tabdiv)'), function(i, val) { var theList = "<ul class='tabs'>\n"; jQuery.each($(this).children('.tabdiv'), function(i, val) { var theName = $(this).children('.noshow:first').text(); theList += " <li><a href='#'>"+theName+"</a></li>\n"; }); theList += "<\ul>\n"; $(this).before(theList); }); } In firefox and chrome, it takes a series of divs, containing headers, and adds a list of those headers before the series... so this: Code: <div> <h2>header1</h2> content </div> <div> <h2>header2</h2> content </div> becomes: Code: <ul> <li><a href="#">header1</a></li> <li><a href="#">header2</a></li> <div> <h2>header1</h2> content </div> <div> <h2>header2</h2> content </div> however, in IE, the error console claims an error on line 7, at the +=, saying that it expected a hexidecimal value... any ideas? p.s. you can see the issue live here http://bit.ly/oYrNAa (sorry bout the url shortener, but i don't want this topic to show up in a search for the site) Hello, can anyone tell me why I am getting a NaN error with this code? It works on the computer but when accessing from the Net I am getting NaN errors for total1 and total3? Thank you! showAnswers1() { var score1 = 5; var total1 = 0; for (var i=0;i<2;i++){ if (eval("document.s1.q" + i + "[0].checked") == true) total1 = total1 + score1 + 5; } for (var i=2;i<18;i++) { if (eval("document.s1.q" + i + "[0].checked") == true) total1 = total1 + score1; } document.cookie = total1; document.s1.yes1.value = total1; } function showAnswers2() { var total1 = document.cookie; var score2 = 5; var total2 = 0; var total3 = 0; for (var i=18;i<20;i++){ if (eval("document.s2.q" + i + "[0].checked") == true) total2 = total2 + score2 + 5; } for (var i=20;i<36;i++) { if (eval("document.s2.q" + i + "[0].checked") == true) total2 = total2 + score2; } total1 = total1 -0; total2 = total2 -0; total3 = total1 + total2; document.cookie = total3; document.s2.yes1.value = total1; document.s2.yes2.value = total2; document.s2.yes3.value = total3; } //--></SCRIPT> |