Interact With An API But Struggling With XHR?
Jan 23, 2010
We're trying to interact with an API but struggling with XHR and how to send data/get response.
If you're able to help with a few small projects please get in touch with your typical hourly rate.
View 1 Replies
Jul 10, 2009
Basically i have this code:
$(document).ready(function() {
$("form").hide();
$(".show").click(function() {[code]....
i am trying to make this code work on an array, ie. i have a for loop spinning out content from my data base and want to be able to to use this function on each paragraph of code individually.Of course i can make the loop increment useing i++ on this links and element ID for example, but i have no clue how to hand this in anyway to the jquery code.
View 2 Replies
View Related
Feb 13, 2011
Folowing the get() example function doSomethingWithData(data) {
[Code]...
View 7 Replies
View Related
May 15, 2009
I'm new to javascript, but I need help and really hoping for a reply. I was trying to find an answer in Google but no result. So I have two table containing images, at the beginning only first table is displayed. Then when one of the images in the first table is clicked, a second table should appear, and user should click one of the images on that table. And that image should replace the one that was clicked originally in the first table.
So the question is, when the user clicks an image in the second table, how do I know what was originally clicked in the first one? I tried to use global variable but that doesn't work.
View 6 Replies
View Related
Sep 29, 2010
[code]When I click on the "Button" link(<a href="#">Button</a>) the following text appears "1234567890" >>This works perfectly.When i click on the text "3345636" it hides over one second as defined in the Java Script >>This works perfectly.The problem is when I click on the new text "1234567890". Even though it has an id="Button" it doesn't hide at all?
View 2 Replies
View Related
Dec 13, 2003
I have the following issue - if a user select 'select box' as a value in a drop-down list, a new window is opened where they can enter values then they should click on a button and a text thay have typed should pass to a hidden field in the parent window.
How do I do this? I tried this (child window)
<html>
<head>
<title>Values</title>
</head>
<body BgColor = "#FFFFFF">
<form name = "f1">
<textarea name = "ta"></textarea><br />
<input type = "button" value = "Ok" onClick = "getValues ();" />
</form>
<script language = "JavaScript">
function getValues ()
{
window.alert ( document.f1.ta.value );
parent.aff.vals.value = document.f1.ta.value;
}
</script>
</body>
</html>
But unfortuanelly it's not working!
View 1 Replies
View Related
Oct 22, 2005
I have an excel sheet with a graph and cells.If i change the value in
the excel cells the graph will reflect.Now i am going to implement this
functionality in html page.I successfully saved this as interactive
html page.Now my requirement changes a bit.The excell cells will not
visible to others.i have a text box,If i change the value in text box
the excel template cell value need to change.
I did the follwing steps for creating interactive html page
1.go to and click save as webpage link
2.selected selection:sheet option button .
3.click the publish button.
View 2 Replies
View Related
Oct 22, 2005
I have an excel sheet with a graph and cells.If i change the value in
the excel cells the graph will reflect.Now i am going to implement this
functionality in html page.I successfully saved this as interactive
html page.Now my requirement changes a bit.The excell cells will not
visible to others.i have a text box,If i change the value in text box
the excel template cell value need to change.
I did the follwing steps for creating interactive html page
1.go to and click save as webpage link
2.selected selection:sheet option button .
3.click the publish button.
View 5 Replies
View Related
Oct 16, 2010
I am confused about the true difference between the two below examples.
first example:
// Demonstrating a problem with closures and loops
var myArray = [“Apple”, “Car”, “Tree”, “Castle”];
var closureArray = new Array();
[code]....
Here we iterate through the length of myArray, assigning the current index of myArray to theItem variable. We declare closureArray 4 times as an anonymous function. The anonymous function in turn declares the predefined write() function, which is passed parameters. Since write() is in closureArray() a closure is created??? During each iteration, theItem is reassigned its value. The four closures reference this value. Since they reference this same value and since this value is reassigned ultimately to the value of the fourth index position, tHe time we execute closureArray later on, all four closures output the same string. This is because all four closures are within the same scope "the same environment" and therefore are referencing the same local variable, which has changed.
I have a couple of problems with this example:
1) I thought a closure is a function that is returned - the inner function is not returned above.
2) theItem is not even a local variable of the parent function (closureArray) - I thought in order for a closure to work, the inner function only accesses the local variables of the outer function, but in this case the local variable is defined OUTSIDE of the parent function.
3) the "the four closures are sharing the same environment." The thing is even in the second example, they are sharing the same environment.
Second example:
// A correct use of closures within loops
var myArray = [“Apple”, “Car”, “Tree”, “Castle”];
var closureArray = new Array();
[code]....
Here we iterate over the length of myArray (4 times), assigning the index of myArray to theItem variable. We also return a function reference to the closureArray during each iteration (closureArray[i]), where i is index number so we assign 4 functon references. So when we iterate through myArray, we immediatelly call the writeItem() fucntion passing an argument of theItem at its current value. This returns a child anonymous function and when that child function is called, it will execute a block that calls the predefined write() method. We assign that returned anonymous function to the variable closureArray. Hence, closureArray holds a reference to that anonymous function. So closureArray during each iteration holds a reference to the anonymous function and we later call closureArray, which in turn calls the anonymous function, therefore calling the predefined write() function to output the local variable of the parent function. This outputs each distinct index of myArray.
This is because since we created the closure, when we call writeItem, passing theItem argument, since theItem is a local variable of the parent function of the closure, it is never destroyed when we later call closureArray (the reference to the child anonymous function)? Yet weren't we using a closure in the first example as well? So whey wasn't those variables preserved?
I don't think it has anything to do with assigning a returned anonymous function to closureArray. Even though an anonymous function creates a new memory position in the javascript engine, therefore not overwriting the other function references we create during the iteration, it's still referring to a local variable declared outside the reference. So if it's about the closure retaining value of parent's local variable even after exiting the parent function allowing for the current indexes to be preserved, then why did the closure in the first example fail to retain each index?
View 7 Replies
View Related
Nov 2, 2011
I am creating a job ticket object that will interact with a database. It has to update the database on the fly via AJAX. Within the job ticket object, I have instances of a Component Object. Within the Component Object, I have an instance of an Editor Object. One of the methods of the Editor object is a function to edit some text and when it's submitted, it will update the database. All of that is working fine. My problem is that I need to refresh the screen with the new contents of the database. I have a method in the Component Object that refreshes the screen, but how do I call it from within the Editor Object? I believe it has to be called there because the editor object has a handler for the form submission and the AJAX function. So I'll have to reference a callback function once the AJAX request is handled, but I don't know how to call it.
I know that sounds kind of convoluted, so hopefully, this very simplified code will paint a better picture of what I'm trying to do:
Code:
Now I want to call refreshScreen, but I don't know how:
View 8 Replies
View Related