Calling 2 Functions From Inside An If Else?

Nov 26, 2010

I have an embarrassingly similar problem to the last time I was here. I have a google map that generates links and checkboxes from an xml file and puts them in a sidebar. The links open infowindows and the checkboxes show or hide lines on the map.

Which all works ok. But (like last time) I have another function that puts arrowheads along those lines to indicate directionality.

The code which turns the lines off and on looks like this:
function togglePoly(poly_num) {
if (document.getElementById('poly'+poly_num)) {
if (document.getElementById('poly'+poly_num).checked) {
gpolys[poly_num].show();

[Code]...

View 5 Replies


ADVERTISEMENT

JQuery :: Calling Other Functions Inside A Function?

Jul 21, 2009

This is probably more of a basic javascript question than a specificjquery function.I have this jQuery function named validateSubmit()which calls two other regular javascript functions. When using IE,both createCharts() and getDirectorIDs get called but when usingFireFox, only createCharts() gets called and never makes it togetDirectorIDs() and I'm not sure why this occurs.

<script type="text/javascript">
// make sure at least one checkbox is checked
function validateSubmit() {

[code]....

View 12 Replies View Related

Calling Two Functions

Jan 23, 2006

When I click on the "Check All" checkbox, it correctly checks all of the boxes in my form, but I would like each checkbox to also call hideLayer2 function just as what would occur if the user checked the boxes individually. Is there a way to call the hideLayer2 function and pass the correct whichLayer and the_box parameters within the DoToAll function? Maybe there is an easier way?
Code:

View 1 Replies View Related

Calling Functions In Different Documents

Jul 20, 2005

I need to know how to call a function in a different document. At the
moment I've tried onFocus but I'm kinda in over my depth. Perhaps if I tell
you what I want to do you can give me the process and I'll go figure out the
code?

My site is divided into two frames, top frame for navigation, bottom frame
for displaying content (called "top" and "main" respectively).

"top" contains 6 images within 6 seperate anchors, that I use as buttons to
switch between sections, the sections being displayed in "main". When the
mouse is over an image, it changes because I use "OnMouseOver", similarly
for "OnMouseOut".

Here is where I get stuck. I want a different image to be displayed as the
relevant button in "top" depending on which main section is loaded into
"main".

I was hoping to solve this by using "onLoad=" in each of the main pages for
each section, that will call a function in "top.html" to cycle through the
list of images changing the relevant image depending on the content of
"main".

I can see an inherent problem here, I have to make every page (could be
hundreds! - nightmare) call this function.

View 3 Replies View Related

Calling Functions From Within A Video

Jun 3, 2010

My client wants to use a video as an intro to his site, but doesn't want to use Flash.

My question is, is it possible to call a JavaScript function from a video file. Or I guess, is there a way to time the page, so that the homepage loads after the video finishes playing?

View 2 Replies View Related

Difference When Calling Functions?

May 9, 2010

i cant seem to understand why some functions that i create i have to call them with the () and some without
example:

js:
function popup()
{
alert('hello world');
}
html:
<input type='button' value='click me' onclick='popup()' /> the obove code will work.. but some functions when they are being called with the () at the end do not work.

View 2 Replies View Related

Calling Functions From A Form?

Feb 25, 2009

I took a quick trip through the FAQ's and Tutorials and a few Searches, but didn't see anything that looked like what I was looking for. First warning - I am completely new to Javascript and have been trying to teach it to myself over just the last week via Internet Examples, reading forums like this one and a book I bought.

Second - I have no idea if I have done this the easy way (or right way), or done it the hard way - and to be honest, I don't care :D It works and that's good enough for me right now. The goal of my script. Pick a random (non-repeating) number. I have a form that allows the user to select how many digits (from 1 to 5) are to be in the number and second line to select how many numbers to display (from 1 to 5).

So far, it all works great. I get my Number of 1 to 5 non-repeating digits and I can select how many of those numbers are displayed. It only works if I load the page and use the IE Refresh button after making my selections. If I use the Go! button, the page reloads with only a single output number using the default settings of the Form.

[Code]...

View 1 Replies View Related

Calling Functions Using Forms

Mar 25, 2006

I've created a selection box (drop down box) with several options for the user to click. What I want is if the user clicks a certain box, then a specific javascript function will run. BTW, I am using Google Maps API here. Code:

View 1 Replies View Related

Use More Than One Onblur For Calling Different Functions?

Mar 2, 2010

In my project I'm using onblur event in four text boxes and using that onblur event i wanna call different javascript functions i.e', like first text box onblur="test()" and in second text box onblur="test1()" etc. But only one onblur onblur is calling the function and other onblurs are not working. So pls tell me how can i put more the one onblur event and javascript functions in a single page.

View 7 Replies View Related

Calling Functions That Were Included Through PHP?

Oct 3, 2010

I have a problem calling Javascript functions that were included through PHP. The site is written in PHP. I

View 11 Replies View Related

Calling Javascript Functions From Applet

Jul 23, 2005

We have an applet that has to support the SUN VMs as well as the MS VM.
The applet receives updates from a server (via tcp or http) and wraps them
up as objects and passes them using the JSObject scripting context to a
javascript function.

This function takes the object and reads the properties and updates a
screen.

All seems simple stuff. The problem is that the MS JVM runs like a rocket,
but the sun vm seems to max out our processor and also takes ages to process
anything.

I have tried logging from the console using debug level 5, and it shows a
lot of back and forth between the applet and the javascript when accessing
methods on the object passed.

Seeing that as a possible problem, I now pass a delimited string to the
front end, and then convert that into an update message purely in javascript
so there is only one hit to the applet per message.

I am still seeing a massive difference between the sun and ms VMs.

Has anyone ever come across this, and is there anything I can do to help
flatten out this performance?

View 1 Replies View Related

JQuery :: Calling The Other Functions (named)?

Feb 1, 2011

I have the following pieces of jquery code.

$(function () {
$('select[id$=lstOwnership]').bind("change keyup", function () {
if ($(this).val() == 2) {

[code]....

Based on this logic, I'd like to show/hide the ID tag based on the values of a drop down list and another textbox. They both work fine but the problem I'm having is that each can cancel out the other. For example, if the 'txtPercentOther' textbox value is 3 and the drop down item has a value of 2, the ID tag is shown which is fine. But if I were to change the drop down list value to something else, it'll hide the ID tag, even though the other text box still has a value of 3 which means the ID tag should remain shown. I'm wondering if I maybe need to name my function so I can call the other in each.

View 5 Replies View Related

Calling Jscript Functions On A WebPage?

Mar 9, 2009

What i want to do is perform an action (specifically click a button) on a web page by executing a program on my computer. I'm guessing you need to activate the button's click event (or whatever javascript uses) on the web page in your program, but I'm not sure how i would go about doing that. Is there a way of doing this in Java?

View 3 Replies View Related

Calling Functions With Parenthis Versus Without

Feb 5, 2010

I'm doing some basic Javascript tutorials on the W3 schools site. Here's my example within the TryIt editor on this page: [URL]

Code:

<html>
<head>
<script type="text/javascript">

[code]....

What is returned in the browser is:

Code:

function myFunction() { return "Hello world!"; }

Why is this? And again, what are the rules for this? When can you get away without the parenthesis, and is it appropriate to use? Is there ever a time when you must not include them? When must you use them?

View 5 Replies View Related

Calling Multiple Functions From A Single Event

Jul 20, 2005

I am trying to call 2 functions from the 1 onMouseOver event on an
anchor tag, but I can't seem to get it to work. the following should
demonstrate

<a onMouseOver="ShowMenu('Menu3');AddMenuToHoldArray('Menu3')">Menu
3</a>

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?

View 10 Replies View Related

Ajax :: Calling The Same Function For Each Onchange, Or Different Functions?

Jul 20, 2010

I'm trying to build a t-shirt creator application w/ php and ajax.You can see where I'm at here.Thus far, I've successfully passed the first parameter from the form via a function called from an onchange event, which uses a php script to pass simple text (for the time being, 'til i get this figured out), which you can see working on the page.trying to update the output w/ each change they make via the form. For every step, the output on the right needs to update.Should I be calling the same function for each onchange, or different functions? Here's what I'm using as far as AJAX/form goes:

Code:
function showShirt(s) {
// CHECKS IF THE STRING IS EMPTY
if (s=="") {[code]...........

View 7 Replies View Related

Calling Separate Functions From A Select List?

Sep 5, 2011

so, I can pass a value from a select list to another function which then decides which function to call, but I want to cut out the middleman, and make the values the function calls, and call them directly on the onchange... I imagine something like this:

<select id="select" onchange="this.value">
<option selected value="function1()">Funtion 1</option>
<option value="function2()">Function 2</option>
<option value="function3()">Function 3</option>
</select>

View 2 Replies View Related

Different Ways Of Calling Functions Work Differently

Mar 4, 2009

I used a menu making program to create a cool new menu for my website, but I can't get it to work properly.The menu code uses this argument: "java script:[code]in my above code there isn't really a space between 'java' and 'script'.

View 1 Replies View Related

AJAX :: Calling Functions From The Main Page?

May 28, 2010

I'm having trouble calling javascript functions that are loaded in the main window.

Here's what happens:

- when a link is clicked on my page, the contents of a div are reloaded with new contents from another file.

- The new file only contains the new contents of the div.

- I want the new contents of the div to call a function that was originally loaded before the new contents were reloaded.

- So, the main page loads the information and the javascript functions. Then, when the link is clicked, the new contents are loaded into the div with a link that calls a function that was already loaded.

- However, nothing happens when I click on the link to call the function.

Is there something I need to do to call the function?

View 1 Replies View Related

Ajax :: Calling Multiple Functions With OnChange?

Feb 25, 2009

I have a series of dropdowns that allow the user to choose country, province and town respectively. The province dropdown is populated by an Ajax function when the user chooses their country, and the town dropdown is likewise populated by the user's selection in the province dropdown. This all works fine.

Of course, my client now wants to add a "major centres" dropdown between the province and town selection. This seemed straightforward to me, however in practice it's proving problematic. The "major centres" are drawn from the same dataset as the towns, however an extra flag is applied so that only records flagged as "main centre" appear.

Called separately , both the town dropdown and the main centre dropdown are populated. However, the problem comes in when the onChange event which is meant to update both dropdowns simultaneously fires. Watching the network behavior in Firefox, I see that calls to the ASP files which populate the town and major centre dropdowns DO happen, though only one of the calls actually returns values. I've checked this in IE7 also, and the same thing happens.

My function is called from the Province dropdown, like so:

Code:
<select name="Province" id="Province" onChange="callOthers(this);">
<option value="">---</option>
</select>

[Code]....

what might cause only the one dataset to be returned via Ajax? Either the towns are populated or the major centres, depending on which order I call the two handleOnChange functions from my callOthers function. As I said, BOTH Ajax calls are made, however only the results of ONE are being used in my page. Could this problem be related to 2 Ajax calls being made too close together?

View 2 Replies View Related

Functions - Passing In Parameters And Then Calling The Function With The Values To Maybe Add Something Together

Jul 27, 2011

I totally understand that in order to learn javascript I need to know how functions work, I understand the basics of passing in parameters and then calling the function with the values to maybe add something together etc I ve read countless articles about functions as well as books etc but I just dont get how they are used and when they should be used etc, the more advanced functions that have maybe 4 parameters and are doing different calculations and returning various values that get fired back into the script just totally confuses me.

What I would like to know is first of all how can I overcome this confusion and also any words of wisdom you may have. I will also add that I have no prior programming experience and have spent the last 2 months frequently hitting my head off a brick wall as I just cant understand javascript.

View 1 Replies View Related

JQuery :: Calling Functions Between Multiple Document Ready Events?

May 29, 2009

I know that you can have more than on document ready event without difficulty. i.e.

$(function(){
// document ready 1
});[code]....

The question I have is, is there any way for them to call functions from one to the other? The following does not work:

$(function(){
function displayMessage(){ alert('hello world'); };
});
$(function(){
displayMessage();
});

This invokes a js error complaining that displayMessage() is not defined.

View 12 Replies View Related

JQuery :: Ready Calling Multiple Functions - The First Function Gets Called But Not The Second?

Oct 3, 2011

I can't seem to get the syntax correct to get this to work. I'm sure it is something simple.I want to call multiple functions inside my document.ready function.The first function gets called but not the second.

$(document).ready(
function GetSuspectCollection() {
$.ajax({[code].....

View 2 Replies View Related

Calling Multiple Functions With A Single Body Onload Call?

Jul 19, 2011

I have a web page that has a short flash show on it, then it redirects to the main site index page, using a setTimout in body onload. That was all working fine. Now I need to add an OS detection function to redirect iphone and ipad users immediately (bypassing the flash pape). So, I have 2 functions that need to be in the body onload. I figured the logical thing to do would be to write another function that calls the first 2, then put that one in the onload. But now nothing is working. I have played with in for an hour with no luck.

Just as a note: Original, before I had to add the OS detection, there was just the delayer function, and it was called thusly:

[Code]...

View 3 Replies View Related

JQuery :: Calling $ From Inside An Iframe?

Sep 9, 2009

i guess this isn't really jQuery specific rather than it is a global JS-thing, but I tried general solutions for this and they all did not work so I figured this might be because I'm trying to do this with the $ function.

What I wanna do is this: I have a document with an iFrame. From inside that iFrame I wanna call the $-function of the original (parent) document. I tried so many things like

parent.$
top.$
window.parent / top.$
the stuff above with .document.$

and other stuff but none of that works. So, how do you call $ of the real document from inside an iFrame?

View 1 Replies View Related

Calling A Variable Inside A Command?

Mar 31, 2010

im not sure now to word it, or how to do it, im a php coder not a javascript -.-but here it is, basicly i have one ajax file and wish to use it for everypage,i tryed to do it so i can just call one function for all ajax uses, but forms seem to be thowing me off when i call it, i stat if its a form or a element,

function ajax(str, b, c) {
a = b;
type = c;
if (type === 'form') {

[code].....

in this, the variable a is set as the id of the elemnt/form, it works fine for elemnts, but not for forms,i think this is because its thinking a is the id, not the variable,

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved