function doSomthing(arrayset1, arrayset2, nutherVariable){
document.theForm.txtBox.value=arrayset1[n] + arrayset2[n];
<!-- No output to form textfield unless array defined within function-->
}
</Script>
</Head>
<Body>
Passes and recieves variables to/from function(s) via Form
</Body
I think what I am asking is what is the syntax to do this.
looking for a way to pass an array to a function. ==================================== <script> function myfunction(arrayname) { document.write("blablabla"+ arrayname[1] +"blablabla"); } </script>
<html stuff>
<script> arrayname = new Array("what", "is", "wrong"); myfunction(arrayname); </script> ====================================
I am working on a simple Expanding Family Tree. There are two principal Objects: Person and Family, and two subsidiary ones: Sibling-sets and multi-Marriage-sets.
When I click on a Family Button, I want to display all the Persons of a Sibling-set. Married Siblings will have a Button. Pressing this should display one or more Marriage-Partners. If these Marriages (Families) have children, they will have a Family-Button.
You will notice the code for the four objects is fairly repetitious, but that for the variable-length Sibling and Marriage Arrays, is what has kept me struggling for days. Lines S04-S10 and M04-M10 appear to be the problems.
Even though I think addSibling() is constructing Sibling objects, S06 reads the Argument vector as a single item S07 tells me the argument-count is 1. so S09 processes only once, and then.. it interprets argv[s] as a single item, but assigns the whole array to this.sibA.
I've now got to form an average of snowfall inputs, taken from looped prompts, however I'm not allowed to use arrays or functions...Almost every example I see uses arrays, such as this one here:http://www.codingforums.com/showthread.php?t=4313Is it possible to not use arrays to form the average? Please describe how to do this in general terms, as was highlighted in that link ^^^ I want to learn, not copy, although one can be derived from the other...What I haveso far, assume all vars have been announced.
for (var d=1; d<=numofinputs; d=d+1) { input = prompt("Enter a data input" + d) }
alright im making a sortable displays in my website but i am trying to figure out how to pass my javascript array to and external php script through POST method so i can update the column, position, hidden, or closed in the database i am using jQuery Sortable Portlets
I am familiar with the user built addEvent function used to load multiple functions in the window.onload property. However, I am curious as to the best way to do this across multiple JavaScript files. I thought I had seen somewhere code similar to the addEvent function was native to JavaScript now but I can't seem to find that anywhere.
Just to clarify, suppose I have 3 JavaScript files:
Code: function foo() { // do something here } fileB
[Code]....
note that it is not feasible to combine those functions into one file as they aren't always loaded together. What's the best way to load them all as a window.load?
I have a choice when creating a new API that I would like other peoples opinions on. Do I use a single Array or Multiple arrays such as: array[1][1] = "ID[56]NAME[Hello World]START[10]"; OR
I'm developing an image slider. I'd like to be able to trigger functions when the mouse leaves an area, sort of like
$('#someDiv').mouseout or $('#someDiv').mouseleave
except instead of passing the div to the function I have a dimension I'd like to pass to it.
I have box like so[code]...
I have calculated the dimensions from the left of the box to 25% of the width of the box to the right (or 100px from the left of the box) and also calculated the height of the box and top offset. I want to be able to say if the mouse leaves those dimensions, run a function.
Can I pass the dimensions and use mouseout or mouseleave? is this possible without using an HTML element?
This code works fine in in FireFox but not in IE... it's written in Javascript & AJAX but I'm pretty sure the JavaScript is the problem...
Basically what this script is supposed to do is when you select a Product Option, it uses AJAX to fill out the Value drop down box with choices. That works fine.
You then select something from the Value drop down box and it then uses AJAX again to fill out the details into the Weight and Price text boxes... This is where it goes wrong. Code:
I have a slideshow using jQuery and just added an apple overlay to the same page, and for some reason, now the slideshow will not work..Here are the links I have..:
Ok, so basically what I've got is a button which when clicked, "opens" a section of the page. I also need the button to "jump" to this section of the page, because it's below the current content and won't be visible. What I've got so far is ...
Javascript <script language="javascript"> function toggle() { var ele = document.getElementById("toggleText"); var text = document.getElementById("displayText"); if(ele.style.display == "block") { [Code]....
If I put two separate buttons, both functions will work. Basically I need them to be on the same function, not sure how to do that?
I'm new here, and new to js. Here is my problem: I have written out a code to make an image switch from state 0 to 1 and back to 0 again (an eye blink). The code works fine, but I would like to write the functions with arguments so it could be applied to more images. I have tried for a few hours (and searched forums) and am getting no where. Here's my code.
Code: function home_blinkDown() { //alert('blink down'); var t = setTimeout("home_blinkSwap('home_js', 'images/main/home_blink.png')", 2000);
I'm using an ajax function to call multiple php files to the same HTML web page. Dividends must be dynamic the data is stock prices. It seems that the last stock price is only updating the other 9 are not is their a limitation to the number of ajax functions used in a single web page. Here is the code I'm using 10 times is separate div's
I have tried a number of variations, like adding "javascript:" in front of the first call, and returning True of False from the first function, but Icant get the second function to fire after the first one has.
by using alerts, and wathcing what IS occuring, I know that the first is being called, but the second isn't.
I did this once some years back, but I can't seem to rember how I did, it, and none of the example that I have located have helped, so can anyone point me in the right direction?
I am very exciting about jQuery but a am not programmer and the way I write functions is probably not most efficient. For example I have 12 collapsible panel that I need to control. Is there better way of writing this?
I would like to simplify some of my jquery code.I have multiple add functions:
Code:
<table1> <form> <input type="text" name="title">
[code]...
With this when you click the first one it works but not the second.I worked my way around this but I had to increment add like add1 add2 add3. Now this creates alot of code in my javascript and html.
I posted a thread a few days ago concerning a bit of javascript code to make checking one checkbox clear another one. I got some great, prompt help. However, I just got back to working on that web page, and realized that the functions only work on the first form on my web page. I have many forms and they are actively named using php.
Here's are the functions (these works for just the first form on the page):
<script type="text/javascript"> function undo_Changes() { if (document.getElementById("Complete").checked==true) { document.getElementById("Needs_Change").checked=false;
I'm trying to make a table that will hide multiple rows in single js functions... now I put together a way to do it, but it requires multiple id declarations in the functions, is there any way to do it with classes instead of IDs, so that I can have a blanket class that I can use?See:
Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml">[code]......