Checkbox Array - Which One Called The Function
Dec 10, 2010
I've tried Googling this, but haven't found anything, yet.If I have an array of checkboxes, and each checkbox calls the same function with onClick, is there a way to indicate to the function which checkbox within the array called the function?
Code:
<input type="checkbox" name="thisCheck" onClick="myFunction();" value="ALL" />
<input type="checkbox" name="thisCheck" onClick="myFunction();" value="abc" />
<input type="checkbox" name="thisCheck" onClick="myFunction();" value="def" />
<input type="checkbox" name="thisCheck" onClick="myFunction();" value="ghi" />
View 9 Replies
ADVERTISEMENT
Apr 23, 2010
Got a problem with the $.get() function on my site..
[Code].....
tunchecked is a checkbox that should call a php function called finishtask. the reload and preventdefault works but not the actual calling of the function.. it works in IE (8), Opera (10.5) but not in Chrome, Firefox(latest) or Safari.
View 3 Replies
View Related
Apr 24, 2011
I have an image sitting in a <td> tag, and I want the image to change every 5 seconds. I have a total of 3 images that I need to cycle, and I need it to go back to image1 after displaying image3 for 5 seconds.
I want to call the changeAd() function from the setInterval method within the startAdPAge() function because I am going to be adding more statements to the startAdPage() function, so the body onload event will call the startAdPage() function, which will in turn, call all the other functions.
I was using an if/else statement in the changeAd(), but that only changed between image1 and image2, so i am trying this array, but now it is not changing at all.
[Code]...
View 3 Replies
View Related
Jul 1, 2010
I'm using the Google AJAX APIs, but some reason google.load works when run through normal javascript, but if I call the method from my jquery ready function it doesn't work. Code and output is below
page.html
<script type="text/javascript">
loadGoogleStuff();
function loaded() {
console.debug("in loaded function");
}
[Code]...
window.loadFirebugConsole is not a function If I comment out line 3 in code.js, the console debug runs okay, so the ready function is running okay. Even though there's a reference to Firebug, the same error occurs in Safari too. Nothing on the page loads.
View 1 Replies
View Related
Jan 28, 2011
I'm trying to make a time script for an app I'm making (this is not an HTML document; it's a .js file to be used with Titanium) however I'm having trouble getting the function to display and update.
function updateClock()
{
setInterval ( 'kiTime()', 1000 );
}
function kiTime ()
{
//Get current date and time
[Code]...
If I use kiTime() under the text field I will get the current time (or at least the time the app was opened), however if I call updateClock() it's blank.
View 4 Replies
View Related
Jan 12, 2010
I have a toggle function that works brilliantly
Code:
// Toggle
function toggleDiv(elementshow, element, elementhide, elementhide2, elementhide3){
[code]....
View 4 Replies
View Related
Oct 28, 2011
calling a php page through AJAX. and it works Aok. I wanted the ajax backend php file to call a function in the front end page. even a simple alert from the backend php file wont work.
My code to call the alert and parent's javascript functions are below.
Simple alert
echo "<script language='javascript'>alert('Please Help Me');</script>";
Calling Front End Page Function
echo "<script language='javascript'>frontend_function();</script>";
View 5 Replies
View Related
Sep 20, 2010
I have a function that sends some data to a PHP file for processing, and call a page refresh after that, but it's not working. This is what I have so far:
function Reload() {location.reload() ;}
function del(v,m,f){
$.post("system/reject.php", {id: v}) ;
javascript:parent.mainFrame.document.location.reload();
}
The function Reload is something else I tried while trying to get it to work but everything I have done so far doesn't work. :(
View 2 Replies
View Related
Jan 5, 2012
I want to run a function only if it has been called from lets say another function, is there an event handler for that? I dont want to call the function on document.ready since it will load without being called?
for example, the below function is run when page loads, how do I just run it only when I call it directly, say from another function..
$(function() {
$( "#progressbar" ).progressbar({ value: 0 });
});
View 4 Replies
View Related
Jul 31, 2011
I've come across functions like the one below in many scripts.I just don't understand the purpose of the parameter! Nothing is being passed into the function when it's being called- so what's the point of specifying an argument???
function doSomething(e) {
if (!e) var e = window.event;
alert(e.type);[code].....
View 8 Replies
View Related
Nov 15, 2011
I'm trying to run this script on Firefox. I'm copying and pasting the whole thing in here just to be safe, but I'm mostly concerned with getting the findLegendary function to call catchPok(). The script executes fine, goes into the battle, but then...does nothing.It runs the catchPok function if I manually click and deselect the "Find Legendary" window option, so alternately, if somebody knows how to make the program automatically click the element at that point to stop repeating the function (maybe?) and it works, I'd be just as happy with that. My best guess is that the autoContinue function might be interfering somehow, since it runs that portion of the code with the manual findLegendary shutoff, but to be honest I'm pretty clueless.
What I want it to do is run the catch function through, catch the game pixel, and then go back to repeating. I don't care how this is accomplished as long as it can feasibly loop. The game rules allow botting, so this isn't against any site rules, either.
// ==UserScript==
// @name Pokemon Vortex Tool
// @namespace vortexrising.tk
[code]....
View 2 Replies
View Related
Apr 3, 2010
I have an image that I have given an onmouseover event to like so..
Code:
<img id="1" alt="" src="images/image.jpg" onmouseover="highlight()" />
<img id="2" alt="" src="images/image.jpg" onmouseover="highlight()" />
what I would like to know is - within the highlight function what ways are there of getting the id of the image element that called the function? I was thinking I could declaritively pass the id to the function like so - onmouseover="highlight(1)". or would onmouseover="highlight(this.ID)" work? Or is there a better way of getting the id of the calling img element from within the highlight function, I'm thinking that perhaps there is a sender object that I can make use of that I don't know about, if so how do I use it?
View 3 Replies
View Related
Jul 23, 2005
I stumbled over a strange behaviour of Mozilla. When I want to access the
caller property of a function that was not called from within another
function, Mozilla seems to abort the script. No error message, no hang, just
stopping script execution at that point. Why? And what is the remedy?
View 4 Replies
View Related
Dec 8, 2009
I have some javascript the works in conjunction with a flash video player. When a user selects a video in the Flash video list and new video is called and begins to play. Also, when that video is selected a function called "doOnMediaLoad()" is called and inside of that function I have put a call to another function that I wrote in the same script.function that is called when user selects flash player video list.
function doOnMediaLoad(e) {
vcomments_changed(e.id); //call to my function
}
[code]....
View 2 Replies
View Related
Dec 9, 2009
I have some javascript the works in conjunction with a flash video player. When a user selects a video in the Flash video list and new video is called and begins to play. Also, when that video is selected a function called "doOnMediaLoad()" is called and inside of that function I have put a call to another function that I wrote in the same script.
[Code]...
View 4 Replies
View Related
Jul 11, 2011
I am making a small gallery script. When a user clicks an image, I would like for a function to be called that tells the browser where that image is located in an object. For example:
[Code]...
It works, I just don't like it because it is messy and it seems sensible that some workaround exists.
View 1 Replies
View Related
Jul 8, 2006
I have some code comprising the onsubmit attrribute of a form. The code is
executing, but apparently a function called as the last statement is not
executed. The form content is submitted to the server. The behavior is the
same in Firefox and IE (current Windows versions). The following is
excerpted from the browser's "View source": Code:
View 3 Replies
View Related
Mar 2, 2009
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"><HTML><HEAD><TITLE>Untitled</TITLE>
<META content="Evrsoft First Page" name=GENERATOR></HEAD>
[code]....
View 4 Replies
View Related
Jan 3, 2011
I need to implement a function called map (it needs to be written using reduce) in the below code that takes an array (arr) and a function (iter) as its arguments and returns an array with all its items transformed by iter, e.g. map([1, 2, 3, 4, 5], function(x) {return x * 2;}) should return [2, 4, 6, 8, 10]
View 6 Replies
View Related
May 30, 2010
My javascript function setHw is not called by pressing the return key in all of the following pages.
View 2 Replies
View Related
Sep 21, 2007
I'm trying to create a function that clicks a link when called. Its working in IE 7 but not in Firefox/Safari. here is the function:
Code:
function open_greybox() {
document.getElementById("grey_link").click();
}
The error console for firefox is telling me: Error: this.document.getElementById("grey_link").click is not a function Does firefox not support "click()"? Is there a workaround? A hidden link has to be clicked by javascript when the function is called (from a flash movie).
View 14 Replies
View Related
May 8, 2010
Is there someway of identifying from which filed the function was called.
<html>
<head>
<script language="JavaScript">
function calLeaveCutting(){
how can i identify here from which input field this function was called I can use getElementByid, but if i do so i need check all the field. I don't want that to happen. Is there someway of identifying from which filed this function was called.
[Code]...
View 4 Replies
View Related
Mar 7, 2011
I am trying to implement the getJSON function.
My code for utilizing the getJSON follows:
Where un in a reference to a Textbox.
I can debug and verify that the call to
Occurs and return correct answers.
My problem is that the "success callback function" of the getJSON function is NEVER called.
View 1 Replies
View Related
Sep 28, 2009
I'm making a call to a Twitter JSON feed, and when I pass an incorrect username, jQuery's ajax complete method never gets called.
An example of a JSON response that causes complete not to be called (nor error, nor success) is: [url]
Here's my code:
Any ideas on why the complete method isn't getting called? Shouldn't this always get called?
View 3 Replies
View Related
Jan 30, 2010
like theres two pages.page one calls page two and displays the output of page 2 on page 1 via ajax.now can i click on page 2's output(on page one) and have it execute another javascript function to call AJAX(a third page)
View 1 Replies
View Related
Feb 23, 2010
function update(value1){
doAjax("behind_scan.php" , "id="+value1);
}function doAjax(url , str ){
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null){
alert ("Browser does not support HTTP Request");
return;
}url=url+"?"+str;
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}function stateChanged(){
if (xmlhttp.readyState==4){
//document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
//alert(xmlhttp.responseText)
document.forms.myform.scanner.value = "";
document.forms.myform.scanner.focus();
}}function GetXmlHttpObject(){
if (window.XMLHttpRequest){
// code for IE7+, Firefox, Chrome, Opera, Safari
return new XMLHttpRequest();
}if (window.ActiveXObject){
// code for IE6, IE5
return new ActiveXObject("Microsoft.XMLHTTP");
} return null;
}
This pages calls a function on a separate php page to run 2 mySQL queries, the value must be put in the text 3 times in quick succession before the database is altered. I've tried all the other functions and they seem to be fine, AJAX is my weakness but I need it for the main functionality of my website. I need this to work.
View 2 Replies
View Related