I am currently writing a program to analyse (to a degree), the points scored in a dance contest. The program mainly works so far. However I am struggling to conclude the program end. Using an if statement, I would like to compute if a dance-off is required, looping through the combinedPointsArray and determining if 2 or more numbers hold the higest score and are equal.The aim is to provide:
Maximum number of combined points
The couples and their combined points
The couples names with the highest points
If two or more couples have equal highest combined points - output whether a dance-off is required.
im not new to javascript but arrays still confuse me exspecialy when put into loops.ok say i had 2 arrays i have used jquerry to extract a question lets say this is the question.How long is a piece of string?so what i want to do is search the question trough a array with 21984 and more in the future when it finds the match it then looks at the answers array at the same array length as where the question was found then sends the answer to a variable for later use could someone give me a example on how to do this please?
What I am trying to do is build a script that will read through an array of words and compare another word to the list to find where it would be placed alphabetically; between which two words would my word go.
Here is what I have come up with so far which doesn't work with words shorter than the shortest word in my list, or words spelled like the shortest word in my list except having a few more characters, plus more various issues.
Example: My list
If I use keywords "apex," or "as", this script fails.
I have a div, which can be anywhere in the document. I want it like, when I click anywhere on the div, it tells me the X, Y of the mouse in the div. Like X mouse - X div (left) and Y mouse - Y div (bottom). So that I know the width and height of the mouse according to the div. Is it possible or cross browser?
I have a div which wraps a table. Initially, the div's display attribute is "none", basically I need to find the height of the table in the div, and use that information to render the div to the user. The div is rendered only on the users request.
I want to be able to find the height of a div in pixels without defining it in JavaScript. The Div needs to be able to have whatever content in it is required, and it will change without a refresh. I have no idea what could possibly do this, I was hoping somebody with more experience with JavaScript could help me :D
It also really needs to be at least Internet Explorer, Firefox and Opera proof.
Title doesn't really give this thread justice ... I have a content div with an image and text included into it. This same div class is being used multiple times. What I want is to be able to click the image, and have the <p> in that div toggle to show or hide. Here is the XHTML code for the front-end:
<div class="content"> <img src="image_big.gif" alt="image" class="toggle_font" /> <p> Caption for the next image. </p>
I'm trying to make some changes to the Javascript portion of our corporate intranet site and I'm trying to find if theres a way to find the User's login id from a Javascript function?
If not, is there a way to run a 'echo %USERNAME%' from DOS command window and obtain the output. I realize there's an inherent security risk if Javascript were to allow that.
Am I barking on a completely wrong tree, is NTLM authentication what I should be looking at?
Basically, I need to get the user id without the user having to supply it on the page manually. Can this be automated?
How would I access the source of a webpage? I would like to get the source, then use a regexp to find text on a webpage. For example, retrieving a counter, or some other text that dynamically changes. I'm implementing this for firefox.
right now, i have a web page opening that contains that info, but i would rather have a pop up alert() that shows that info.
where the selectors and their opening braces, their closing braces, and declarations are each on their own lines (always), how can I replace a specific declaration (line) given a unique selector and a declaration property. For example, if I wanted the 'color' declaration property line in the 'bar' class changed.
At the moment I'm iterating through the CSS one line at a time looking for the selector and then looking for the declaration property (before I hit the closing brace).
I have a link styled with css that I'd like to change with a mouse event. It's going to be on a touch screen so I'm assuming I should adopta mouseUp/mouseDown model?
i am creating a simple dynamic menu for my study with the following structure:
[Code]...
now i need to find the correct selector for the mouseout event, because now the submenu disappears if i am getting of the current element (this) of the mainmenu, but i only want it to disappear if it is not anymore over the submenu, or if the mouse goes over another element of the main menu.
I'm looking for a sleep function in JS. An event is triggered on mouse-out. But I want the action to kick off x seconds AFTER the event. So, perhaps I'm looking for a "sleep" function in the event function?
I have what I thought was a fairly simple problem that I would be able to solve on my own, but the code I have found is just too complicated for me to understandI think what i have is similar to the knapsack problem, but I have a really simple version of/~moshe/recor/knapsack/knapsack.html#defSay I have a relatively small array of numbers:2, 2, 3, 3, 4, 4, 5, 5, 5, 6, 7, 8, 9, 10. I just need to verify true or false if a combination of these numbers will add up to 21. The numbers will obviously be changing, ( and in array size), i guess i could just use if statements but it would be stupid and go on for ages.Could anyone point me in the direction of some simple code, or easy to understand way to go about this problem?
Alright so for my website (I've totally revamped it and what not) I want to make a code highlighter for source code / tutorials I've posted. At the moment I'm just using some css:
So the code stays neat and in a box. But what I want to do now is somehow make a small javascript function that scans the text inside the html file etc :
[Code]...
and can format it so float and int is blue, "hello world" is red etc. As from the javascript I've done myself I can't see it being to hard. I'm just unsure how to scan for text inside like I have above.
However this doesn't always work in my script. Now, I've googled how to find the position of an element. And come accross many scripts which supposedly all find the position of any object. Some are very long scripts and some are very short all using a variety of methods. Incidently none of which work, they all return (0,0).
I'm having a hard time trying to get this script to work. I am trying to write a script that finds the highest of 5 numbers and places the highest number in the last textbox.Can anybody tell me what I am doing wrong?
<HTML> <HEAD> <TITLE>COMSC-100-1241 - Assignment #10 - Using "Greater Than" And "Less Than" Logic</TITLE>
trying to read text from text child, basicaly seeking for equvivalent for this:
var groupArray = secondElement.getElementsByTagName("DIV"); // so looking for text nodes var groupArray = secondElement.getElementsByTagName("??????");
hmm tryed this, seems DOM doesn't see the text node that itself created
//2.TRANSFERING ALL CHILDS TO secondElement // case1 --> ONLY IMAGE APPEARS !!?? for (i = 0; i < firstElement.childNodes.length; i++) { secondElement.appendChild(firstElement.childNodes[i]); }
//case2 --> TEXT AND IMAGE APEARS secondElement.innerHTML = firstElement.innerHTML;