JavaScript - I Did A Lot Of Kind So I Am Hoping Someone Is Willing To Help Me Lol
Here is my assignment
http://www.sci.brooklyn.cuny.edu/~ci...omework3B.html Here is my html file, magic.html: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <SCRIPT SRC="Project3B.js"> </SCRIPT> </head> <form name="sqaure"> <table border="1"> <tr><td><input type="text" id="a00" size="4"/></td> <td><input type="text" id="a01" size="4"/></td> <td><input type="text" id="a02" size="4"/></td></tr> <tr><td><input type="text" id="a10" size="4"/></td> <td><input type="text" id="a11" size="4"/></td> <td><input type="text" id="a12" size="4"/></td></tr> <tr><td><input type="text" id="a20" size="4"/></td> <td><input type="text" id="a21" size="4"/></td> <td><input type="text" id="a22" size="4"/></td></tr> </table> <button onclick="compute(sqaure);">check</button> </form> </div> </body> </html> Here is my .js file also properly named: Code: <!-- hide script from old browsers function compute ( f ) { var isDifferent=true; var addsToSame=true; if( (distinct ( create_square (f) ) ) == false) { isDifferent=false } if( (same_sum( create_square (f) ) ) == false) { addToSame=fa;se; } } function create_square ( f ) { Array = new Array(2); Array [0] = new Array(2); Array [0][0] = a00.value; Array [0][1] = a01.value; Array [0][2] = a02.value; Array [1] = new Array(2); Array [1][0] = a10.value; Array [1][1] = a11.value; Array [1][2] = a12.value; Array [2] = new Array(2); Array [2][0] = a20.value; Array [2][1] = a21.value; Array [2][2] = a22.value; return Array; } function distinct(a) { var isDistinct=true; var h=0; var i=0; var j=0; for (h=0;h<3;h++) { for (i=0;i<3;i++) { for(j=0;j<3;j++) { if(isDistinct==true) { if(a[h][j]==array[i][j]) { isDistinct=false; } } } } } if(isDistinct=false) { alert ("Not all numbers are distinct") return isDistinct; } } function same_sum(a) { var sum = 0; var i = 0; var TorF = true; for (i=0;i<3;i++) { if (TorF == True) { if( var sum != 0) { if( sum != row_sum(a, i) ) { TorF = false } } else { sum = row_sum( a, i) } } } for (=0;i<3;i++) { if (TorF == True) { if(sum != col_sum(a, i) ) { TorF = false } } } if(TorF == False) { alert ("Not all rows/columns add to same number") return TorF; } } function row_sum(a, r) { var total=a[r][0]+a[r][1]+a[r][2]; return total } function col_sum(array, i) { var total=a[0][c]+a[1][c]+a[2][c]; return total } // end hiding script from old browsers --> Sorry if it looks really odd...i am not entirely sure on javascript, I sorta....partially writing the code based on my experience with C++, and I have heard that would punish me ofcourse...but...the program seemed easy enough. Anyway help would be appreciated...if someone could recommend me a program or something I could use for debugging for javascript that would also help. PS....the title is supposed to be "I did a lot of code kinda so I am hoping someone is willing to help me lol"...its late >.> Similar TutorialsHello I work for a small company and alot of the people we deal with are old and not good with computers. I'm trying to make a dropdown combo-box that will help them find what they need. I've gotten the boxes working, but I need the results to then go into a search box. Any help would be greatly appreciated. <html> <!-- Created on: 3/24/2011 --> <head> <script type="text/javascript"> var categories = []; categories["startList"] = ["Activa","Bell Horn","Diabetic Crew","Futuro","Jobst","Sensifoot","TruSock"] categories["Activa"] = ["Male","Female"] categories["Bell Horn"] = ["Male","Female"] categories["Diabetic Crew"] = ["Male","Female"] categories["Futuro"] = ["Male","Female"] categories["Jobst"] = ["Male","Female"] categories["Sensifoot"] = ["Male","Female"] categories["TruSock"] = ["Male","Female"] categories["Male"] = ["Ankle High","Crew","Knee High"]; categories["Female"] = ["Ankle High","Crew","Knee High"]; categories["Ankle High"] = ["8-15 mmHg","15-20 mmHg","20-30 mmHg","30-40 mmHg"]; categories["Crew"] = ["8-15 mmHg","15-20 mmHg","20-30 mmHg", "30-40 mmHg"]; categories["Knee High"] = ["8-15 mmHg", "15-20 mmHg", "20-30 mmHg", "30-40 mmHg"]; categories["8-15 mmHg"] = ["Casual","Dress"]; categories["15-20 mmHg"] = ["Casual","Dress"]; categories["20-30 mmHg"] = ["Casual","Dress"]; categories["30-40 mmHg"] = ["Casual","Dress"]; var nLists = 5; // number of select lists in the set function fillSelect(currCat,currList){ var step = Number(currList.name.replace(/\D/g,"")); for (i=step; i<nLists+1; i++) { document.forms['tripleplay']['List'+i].length = 1; document.forms['tripleplay']['List'+i].selectedIndex = 0; } var nCat = categories[currCat]; for (each in nCat) { var nOption = document.createElement('option'); var nData = document.createTextNode(nCat[each]); nOption.setAttribute('value',nCat[each]); nOption.appendChild(nData); currList.appendChild(nOption); } } function getValue(L4, L3, L2, L1, L5) { alert("Your selection was:- \n" + L2 + "\n" + L1 + "\n" + L3 + "\n" + L4 + "\n" + L5); } function init() { fillSelect('startList',document.forms['tripleplay']['List1']) } navigator.appName == "Microsoft Internet Explorer" ? attachEvent('onload', init, false) : addEventListener('load', init, false); </script> </head> <body> <table border="0" summary=""> <tr> <td><BR> <b>Brand: </b><BR> <b>Gender: </b><BR> <b>Cut: </b><BR> <b>Compression: </b><BR> <b>Style: </b> </td> <td><BR> <BR> <form name="tripleplay" action=""> </b><select name='List1' onchange="fillSelect(this.value,this.form['List2'])"> <option selected>Make a selection</option> </select> <BR> </b><select name='List2' onchange="fillSelect(this.value,this.form['List3'])"> <option selected>Make a selection</option> </select> <BR> <select name='List3' onchange="fillSelect(this.value,this.form['List4'])"> <option selected>Make a selection</option> </select> <BR> <select name='List4' onchange="fillSelect(this.value,this.form['List5'])"> <option selected>Make a selection</option> </select> <BR> <select name='List5' onchange="getValue(this.value, this.form['List1'].value, this.form['List1'].value)"> <option selected >Make a selection</option> </select> </form> </td> </tr> </table> <input type="text" name="testField" maxlength="50" size="30" value="This is where I want the result to go."> </body> </html> I am trying to do a title case project and can't figure out where I went wrong. Any help would be appreciated. <!DOCTYPE html> <html lang="en"> <head> <title>Title Case</title> <meta charset="utf-8"> <script type="text/javascript"> function titleCase() { var word = document.forms[0].string.value.split(" "); var cword = ""; for (var i = 0; i < word.length; i++) { cword = cword + word[i].substr(0, 1).toUpperCase() + word[i].substr(1).toLowerCase() + ((i < word.length - 1) ? " " : ""); } return cword; } </script> </head> <body> <h1>Title Case</h1> <form action="" method="get"> <p><input type="text" name="string" /> <input type="button" value="Convert to Title Case" onclick="titleCase()" /></p> </form> </body> </html> Hi, I really need to know how to do this kind of websites. ( i don't know if this is the right place, so you can move it) This one is a train website, where the visitor pur the url with a picture of their tumblr or twitter just like this one http://www.tumbletrain.com/ Does anyone know how to do this kind of website? Do i need an application installer or is it just coding?? Also the other website is like a list where the visitor can put their link to their website, and it appears in the index page.. Just like this website http://tumblrplug.com/ What do i need to do it? Does anyone know? Do i need to use wordpress and some kind of coding?? I know about php coding, and web design, i'm not a novat but i just coudn't find out how to do those kind of websites.. Please can anyone help me? I'd really appreciated that.. Thank you What do you call this kind of javascript array? Code: var markers = [ { lat: -33.85, lng: 151.05, name: "marker 1" }, { lat: -33.90, lng: 151.10, name: "marker 2" }, { lat: -33.95, lng: 151.15, name: "marker 3" }, { lat: -33.85, lng: 151.15, name: "marker 4" } ]; markers[0].name= "wow I was able to do this"; I don't see any javascript documentation on this. I want to have a real time text ticker. I would be able to type something in and it would continue to scroll until I typed something else (followed by the return key), and it would scroll that, without the end-user having to refresh their screen to see the update. I was hoping their might be a script out there already that does that, but since I can't find one, I thought I'd see about trying to create one. What would be the most practical scripting language to use? Or if you know of something that does this already, could you point me in the right direction. Hi, In our static few page website, when user open the home page, I want to open one "prompt" kind of window with my own input fields: e.g. One Simple Text Line One anchor link to external link One Text Box to input product key Ok Button Cancel Button. I want this "prompt" kind of window compulsory to attend. Means user will not be able to access the page without responding this window. According to user button pressed "OK" or "Cancel", I want to display the corresponding text in the home page. In short, it will be close to the "window.prompt" but customized and compulsory to respond. Thanks, I have been to this forum many times as a lurker and I have picked up some good information. For this I give Thanks wholeheartedly. My situation: I enter information in a system based on the # of a report that comes in. So if I see a report that says "333" i want to enter specific information for "333" same with "444" and "555" and so on and so forth. So I want to have a drop down menu for 111, 222, 333, 444 etc... Basically what I need is, if I select the report # from the drop down menu, I want it to copy information from a HIDDEN textbox to the clipboard. That's it! I've been trying to figure it out, but to no avail. Sorry I am fake coder Hi, i want to create this Login-Button: www.ogame.org Can you give me an idea how that works? Thank u, nvidia |