JavaScript - Help With Error In Hta File
I am recieving an error of Access Denied in a HTA file when the self.ResizeTo is called in the following code on Line 59 any help would be great.
<html> <title>Personal Folder Creator</title> <HTA:APPLICATION ID="objPersonalFolderCreator" APPLICATIONNAME="PersonalFolderCreator" WINDOWSTATE="normal" > <head> <style> BODY { font-family: verdana; font-size: 8pt; } H2 { color: blue; } .Table { font-size: 10pt; border-width: thin; border-style: solid; padding: 10px; } .ResultsTable { border-width: thin; border-style: solid; font-size: 8pt; } </style> '******************************************************************** '* BEGIN_SCRIPT '******************************************************************** <script language="vbscript"> Option Explicit Dim objShell, objFSO Dim strServer, strPath strServer = "TWB-FLS-PR-01" strPath = "Personal" Sub Window_Onload Set objShell = CreateObject("WScript.Shell") Set objFSO = CreateObject("Scripting.FileSystemObject") ParentFolder.Disabled = True SubmitButton.Disabled = True PopulateParentFolders self.Focus() self.ResizeTo 720,410 UserID.Focus() End Sub Sub PopulateParentFolders Dim objFolder, objTempFolder, strTempPath strTempPath = "\\" & strServer & "\" & strPath Set objFolder = objFSO.GetFolder(strTempPath) For Each objTempFolder In objFolder.SubFolders Dim objoption Set objOption = Document.CreateElement("OPTION") objOption.Text = objTempFolder.Name objOption.Value = objTempFolder.Name ParentFolder.Add(objOption) Next End Sub Sub LookupButton_OnClick() Dim objUser Set objUser = GetObject("WinNT://PRDS/" & UserID.Value) lblUserName.innerText = objUser.FullName If InStr(lblUserName.innerText, "(") > 0 Then lblSubFolder.innerText = Mid(lblUserName.innerText, 1, InStr(lblUserName.innerText, "(") - 1) ElseIf InStr(lblUserName.innerText, "[") > 0 Then lblSubFolder.innerText = Mid(lblUserName.innerText, 1, InStr(lblUserName.innerText, "[") - 1) End If ParentFolder.Disabled = False SubmitButton.Disabled = False LookupButton.Disabled = True UserID.Disabled = True lblStatus.innerHTML = "Select Parent Folder - DEFAULT is PERSONAL." End Sub Sub SubmitButton_OnClick() Dim strCommand Dim intReturn If objFSO.FolderExists(lblTargetFolder.innerText) Then MsgBox "Folder Already Exists!", vbExclamation lblStatus.innerHTML = "<font color='red'>Folder Already Exists.</font>" Exit Sub Else If MsgBox("Create the Personal Folder:" & vbNewLine & lblTargetFolder.innerText, vbYesNo + vbQuestion) = vbNo Then Exit Sub End If End If objFSO.CreateFolder(lblTargetFolder.innerText) strCommand = "SUBINACL /file """ & lblTargetFolder.innerText & """ /perm /grant=Administrators=F /grant=SYSTEM=F /grant=PRDS\sor-A-Admins=F /grant=PRDS\" & UserID.Value & "=C /setowner=Administrators" intReturn = objShell.Run(strCommand, 7, True) If intReturn <> 0 Then MsgBox "Error modifying permissions on folder: " & lblTargetFolder.innerText,vbExclamation Else SubmitButton.Disabled = True ParentFolder.Disabled = True MsgBox "Personal Folder Created and Permissions have been set accordingly." & vbNewLine & "Advise Customer the Path to their Personal Folder.", vbInformation lblStatus.innerHTML = "<font color='green'>Folder Created Successfully.</font>" End If End Sub Sub ResetButton_OnClick() ParentFolder.Disabled = True SubmitButton.Disabled = True LookupButton.Disabled = False UserID.Disabled = False ParentFolder.Value = "NUL" lblUserName.innerText = "" lblSubFolder.innerText = "" lblTargetFolder.innerText = "" UserID.Value = "" UserID.Focus() lblStatus.innerHTML = "Enter User ID and Click Lookup." End Sub Sub ParentFolder_OnChange() If ParentFolder.Value = "NUL" Then lblTargetFolder.innerText = "" lblStatus.innerHTML = "Select Parent Folder." Else lblTargetFolder.innerText = "\\" & strServer & "\" & strPath & "\" & ParentFolder.Value & "\" & lblSubFolder.innerText lblStatus.innerHTML = "Ready to Create Folder." End If End Sub </script> '**************************************************************************** '* END_SCRIPT '**************************************************************************** </head> '**************************************************************************** '* HTML Section '**************************************************************************** <body> <h2 align="center">Personal Folder Creator - TWB-FLS-PR-01</h2> <table id='tblInput' class='Table' width="670"> <tr><td><b>User ID: </b></td><td rowspan="2"><input type='text' name='UserID' size='10'><button name='LookupButton'>Lookup</button> <p><select name='ParentFolder'><option value='NUL'>Select</option></select></td> <td rowspan="2"> </td><td rowspan="2" width="324"> <img border="0" src="http://sor-app-pr-01:78/_layouts/images/IT_support.gif" width="324" height="103"></td></tr> <tr><td><b>Parent Folder: </b></td></tr> </table> <br/> <table id='tblSummary' class='Table' width="670"> <tr><td><b>User Name: </b></td><td><div id='lblUserName'> </div></td></tr> <tr><td><b>Personal Folder: </b></td><td><div id='lblSubFolder'> </div></td></tr> <tr><td width='15%'><b>Target Folder: </b></td><td width='85%'><div id='lblTargetFolder'></div></td></tr> <tr><td><b><font color="#FF0000">Status:</font> </b></td><td><font color='red'><div id='lblStatus'>Enter User ID and Click Lookup.</div></font></td></tr> </table> <br/> <div align="left"> <table id='tblButtons' class='Table' style="border-style: solid"> <tr><td> <p align="center"><button name='SubmitButton'> <p align="left">Create Folder</button></td><td> <p align="center"><button name='ResetButton'>Reset</button></td><td> <p align="center"><button name='ExitButton' onClick='self.Close()'>Exit</button></td></tr> </table> </div> <br/> Version 1.1(SOR) : Last Modified 11-08-2008 by Steve Dudley : ITO SOR <br/> Version 1.0 : Created on 04-01-07 by Adam Rutt : ISB DTSG </body> </html> Similar TutorialsHi, I have the following script which should work in theory, however I get the error message that file is not defined. I have tried playing around with using variables and I can not work out how to correct this. My code is: Code: <head> <script type="text/javascript"> function loadXMLDoc(File,ID){ if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4 && xmlhttp.status==200){ document.getElementById(ID).innerHTML=xmlhttp.responseText; } } xmlhttp.open("POST",FILE,true); xmlhttp.send(); } </script> </head> <body> <input type="button" value="Test" onclick="loadXMLDoc($File='getToday.php','txtHint');" > <input type="button" value="Test2" onclick="loadXMLDoc($File='getTomorrow.php','txtHintTom');" > Hi, I am trying to get this function to work, it looks great in theory but I keep getting the error message file is not defined. What have I done wrong? The code is: Code: <head> <script type="text/javascript"> function loadXMLDoc(File,ID){ if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); } else { xmlhttp=new ActiveXObject("Microsoft.XMLHTTP"); } xmlhttp.open("POST",FILE,true); xmlhttp.onreadystatechange=function(){ if (xmlhttp.readyState==4 && xmlhttp.status==200){ document.getElementById(ID).innerHTML=xmlhttp.responseText; } } xmlhttp.send(); } </script> </head> <body> <input type="button" value="Test" onclick="loadXMLDoc('getToday.php','txtHint');" > <input type="button" value="Test2" onclick="loadXMLDoc('getYesterday.php','txtHintYest');" > </body> Hi I'm reading a text file, manipulating the string that I've read, and then writing to a new text file called temp. The error that I am getting is basically reading past the end of the file. function SpaceFileEntries() { fso = new ActiveXObject("Scripting.FileSystemObject"); filename = "NDELPROF.txt"; path1 = document.getElementById("lblDataOutputDirectory").innerText + "\\" + filename; path2 = document.getElementById("lblDataOutputDirectory").innerText + "\\temp.txt"; s = fso.OpenTextFile(path1); j = fso.CreateTextFile(path2 , true); do { text = s.readLine(); partOne = text.substring(0,34); lastPart = text.substring(35, 54); space = " "; j.write(partOne); j.write(space); j.writeline(lastPart); } while ( text != null ) s.Close(); j.Close(); } Can someone please help me find this bug in the code. I know it's got to do with the while statement, but can't think or find good alternatives. Thanks. Daniel Hi I have written the following code to read contents of a text file using FileReader object of HTML 5 for Google Chrome. Quote: <script> function handle_files(files) { var i; if (checkBrowser("Chrome")) { for (i = 0; i < files.length; i++) { file = files[i]; var reader = new FileReader(); ret = []; reader.onload = function (e) { console.log(e.target.result) } reader.onerror = function (stuff) { console.log("error", stuff) console.log(stuff.getMessage()) } text = reader.readAsText(file[i]); alert(text); } } } </script> ---------------------- <input type="file" multiple="multiple" onchange="handle_files(this.files)"> Unfortunately, the variable text always displays as undefined. Everything above the line text = reader.readAsText(file[0]); works fine. How can I fix it?. Or is there any other solution to read a text file using HTML5/JavaScript on Chrome? Thanks in advance. Hello, i'm trying to insert a dynamic js file which contains multiple functions in it (for the example : function x, function y) and it seems that my google chrome doesn't really like it so much is there anyway you know i can bypass it and make it work and both web browsers code examples: // this is where the js file supposed to go <script id="ScriptFile"> </script> //1.js contains function x and function y document.getElementById('ScriptFile').src = "/Mysite/js/1.js" later on i need to preform some actions with function x & y. Couple more issues i need to explain first there are number of js files (1,2,3 .... n ) which all contain the same functions but with different data so i cant register them hard-coded if i type the function x into the "ScriptFile" block, it does work.. its not the function problem. same goes if i include it as source in the "ScriptFile" block (<script id="ScriptFile" src="/Mysite/js/1.js") this only gives me an error while using chrome, works perfectly fine under explorer the error says it cant find function x. thanks alot! (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} } Hi, Can someone tell me what I am doing wrong. Script works on the first attachment but not the other two? Code: <script type="text/javascript" language="JavaScript"><!-- function ExtensionsOkay() { var extension = new Array(); var fieldvalue = new Array(); fieldvalue[0] = document.customApp.attachment_1.value; fieldvalue[1] = document.customApp.attachment_2.value; fieldvalue[2] = document.customApp.attachment_3.value; extension[0] = ".doc"; extension[1] = ".docx"; extension[2] = ".txt"; extension[3] = ".pdf"; // No other customization needed. for(var f = 0; f < fieldvalue.length; f++) { var thisext = fieldvalue[f].substr(fieldvalue[f].lastIndexOf('.')); for(var i = 0; i < extension.length; i++) { if(thisext == extension[i]) { return true; } } alert("Your upload field " + f + " contains an unapproved file name."); return false; } } //--></script> I can get this code to take two separate sections of a file which are not beside each other and write them into another file. It always comes up as a single full line of the code instead of the sections I want. The code includes the student number first name last name and three results of assignments. I want the code to write the student number and three results of all the students into a file and then work out the average of the student results. Can you help? Code: try{ while (in.hasNextLine()) { String line = in.nextLine(); out.println( line); int i=0; if(!Character.isDigit(line.charAt(i))) { i++; } studentStringNumber = line.substring(0, i); String stringResult = line.substring(i); studentStringNumber = studentStringNumber.trim(); stringResults = stringResults.trim(); double stringResultsValue = Double.parseDouble(stringResults.trim()); stringResults = in.nextLine(); studentStringNumber = in.nextLine(); studentNumber = Integer.parseInt(studentStringNumber); if(in.hasNextInt()) { int value = in.nextInt(); } results = Double.parseDouble(stringResults); if(in.hasNextDouble()) { double value = in.nextDouble(); } Scanner lineScanner = new Scanner(line); studentStringNumber = lineScanner.next(); while(!lineScanner.hasNextDouble()) { studentStringNumber = studentStringNumber+ " " +lineScanner.next(); } stringResultsValue = lineScanner.nextDouble(); } } Hi i am using javascript for the first time and i have a problem .I have 2 files html and javascript file in seperate but i donot know how to make them work .the code is down below .Thanks in advance for help. HTML <!DOCTYPE html> <html> <head> <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script> <meta name="description" content="Instagram API - usage" /> <meta charset=utf-8 /> <title></title> </head> <body> <input id="lat_input" type="number" value="60.221374"/> <input id="lng_input" type="number" value="24.805391"/> <button id="search_location">Search</button><br/> <button id="get_popular">Get popular</button> <div id="images"></div> </body> </html> Javascript file // API DOCUMENTATION: // Instagram Developer Documentation var clientId = 'e7538f47e197479d8d32a63ae3ae4cd2'; $('#search_location').click(function () { getMediaByLocation($('#lat_input').val(), $('#lng_input').val()); }); $('#get_popular').click(function () { getPopularImages(); }); function getMediaByLocation(lat, lng) { var o = { lat: lat, lng: lng, client_id: clientId }; $.getJSON('https://api.instagram.com/v1/media/search?callback=?', o, function (response) { processImages(response.data); }); } function getPopularImages() { var o = { client_id: clientId }; $.getJSON('https://api.instagram.com/v1/media/popular?callback=?', o, function (response) { processImages(response.data); }); } function processImages(array) { $('#images').empty(); $.each(array, function (index, element) { var fs = $('<fieldset>').appendTo('#images'); $('<img>').attr('src', element.images.low_resolution.url).appendTo(fs); if (element.caption) { $('<pre>').text(element.caption.text).appendTo(fs); } $.each(element.comments.data, function (index, comment) { $('<pre>').text('Comment from ' + comment.from.full_name + ': ' + comment.text).appendTo(fs); }); }); } Does anyone know how to accomplish this? I got the html file to show but none of the text in the file will show.
Hello all, I am new here and have a question about a AP Div I am using as a dropin. It drops in when the page loads and I would like it to only drop in if a visitor clicks a link I designate as the dropin link. Can someone please tell me how to accomplish this? I am pasting in the js file and I will also need to know how to set up the "a href" link to call the dropin! Thanks is advance for any help you may give! Code: // JavaScript Document var ie=document.all var dom=document.getElementById var ns4=document.layers var calunits=document.layers? "" : "px" var bouncelimit=32 //(must be divisible by 8) var direction="up" function initbox(){ if (!dom&&!ie&&!ns4) return crossobj=(dom)?document.getElementById("dropin").style : ie? document.all.dropin : document.dropin scroll_top=(ie)? truebody().scrollTop : window.pageYOffset crossobj.top=scroll_top-250+calunits crossobj.visibility=(dom||ie)? "visible" : "show" dropstart=setInterval("dropin()",50) } function dropin(){ scroll_top=(ie)? truebody().scrollTop : window.pageYOffset if (parseInt(crossobj.top)<100+scroll_top) crossobj.top=parseInt(crossobj.top)+40+calunits else{ clearInterval(dropstart) bouncestart=setInterval("bouncein()",50) } } function bouncein(){ crossobj.top=parseInt(crossobj.top)-bouncelimit+calunits if (bouncelimit<0) bouncelimit+=8 bouncelimit=bouncelimit*-1 if (bouncelimit==0){ clearInterval(bouncestart) } } function dismissbox(){ if (window.bouncestart) clearInterval(bouncestart) crossobj.visibility="hidden" } function truebody(){ return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body } window.onload=window.setTimeout(initbox,5000); All -- I have a JavaScript config file called gameSetting.js which contains a bunch of variables which configures a particular game. I also have a shared JavaScript library which uses the variables in gameSetting.js, which I include like so: <script type="text/javascript" src="gameSetting.js" ></script> <script type="text/javascript" src="gameLibrary.js" ></script> In gameSetting.js I have: $(document).ready(function() { // call some functions / classes in gameLibrary.js } in Firefox, Safari, and Chrome, this works fine. However, in IE, when it's parsing gameSetting.js, it complains that the functions that live in gameLibrary.js aren't defined. When it gets to parsing gameLibrary.js, the variables in gameSetting.js are reported as not being defined. I've tried dynamically bootstrapping the gameLibrary file using this function in document.ready for dynamic load... $.getScript("gameLibrary.js"); However, the same problem still happens in IE, where when it parses the files individually it's not taking into context the file/variables that came before, so it's not an out of load order problem. My options a 1) collapsing all the functions in gameLibrary.js and variables in gameSetting.js into one file. However, this is not practical because this is dealing with literally hundreds of games, and having a gameLibrary.js in ONE location for ONE update is what makes most logical sense. 2) figure out a way to get this to work where variables in file1 are accessible to file2 in IE (as it seems they are in other browsers). jQuery seems to be able to have multiple plugins that all refer to the based jQuery-1.3.2.js, so I know there is a way to get this to work. Help appreciated. Nero 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? I tried to follow directions here http://www.javascriptkit.com/javatut...ernalphp.shtml and here http://codingforums.com/showpost.php...91&postcount=4 without any luck. Data is looked up from a MySQL database via .php file and then I want javascript inserted into the .js file which includes the data from the query lookup in the .php file. If I load the .php file - everything looks good. But nothing shows in the .js file. Below is the contents of the .php file which is located at http://blackburnseminars.com/wp-cont...is_prices.php: Code: <?php //PHP SCRIPT: get_regis_prices.php header('Content-type: application/x-javascript'); //connect to database mysql_connect("localhost","username","password"); //(host, username, password) //specify database mysql_select_db("dbname") or die("Unable to select database"); //select which database we're using $str="\r"; //CRLF $result = mysql_query("select * from table_name"); while ($row = mysql_fetch_object($result)) { echo "document.write(var fee = \"\";)".$str; echo "document.write(if (studentTypeAbbrev == \"A\"))".$str; echo "document.write({)".$str; echo "document.write(if (creditHours==1) fee =" . $row->atty_crs1.";)".$str; echo "document.write(if (creditHours==3) fee =" . $row->atty_crs3.";)".$str; echo "document.write(document.write(if (creditHours==6) fee =".$row->atty_crs6.";)".$str; echo "document.write(})".$str; echo "document.write(else if (studentTypeAbbrev == \"P\"))".$str; echo "document.write({)".$str; echo "document.write(if (creditHours==3) fee =" . $row->para_crs3.";)".$str; echo "document.write(if (creditHours==6) fee =" . $row->para_crs6.";)".$str; echo "document.write(})".$str; echo "document.write(else if (studentTypeAbbrev == \"J\"))".$str; echo "document.write({)".$str; echo "document.write(fee =" . $row->judge.";)".$str; echo "document.write(})".$str; } ?> The .js file has this line inserted where I want the javascript from the .php file to go: Code: <script type="application/x-javascript" src="http://blackburnseminars.com/wp-content/themes/blackburn/get_regis_prices.php"></script> ...but the code from the .php file doesn't show when I load the .js file. Can anyone tell me what I am doing wrong? Also, do I need to enclose the lines inside document.write()? - (I'm not clear on that) Thanks much Tom Esker help me! im have 2 file .js file 1.js code: document.write("<script src=2.js></script>") document.write(f) file 2.js code: var f="hello" im want run 1.js get variable of file 2.js by 3.html but don't run! code 3.html <script src=1.js></script> 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> "); }); }); 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. 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> 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 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 |