Tagged Questions
0
votes
2answers
37 views
How do I reverse this JavaScript code?
I have a webpage that has a link set to change the background colour of the page, the colour of the link, & the link text. Here is my code:
<html>
<head>
...
0
votes
1answer
32 views
javascript - can't compare var of type int in conditional statements
I declare global var in script sitting in the head:
var numMonsters;
then i have somebody setup div with form that call js function also located in the head and there i assigning this var:
...
1
vote
2answers
32 views
JavaScript function arguments statements
My problem is:
(only as example, must not make sense overall):
// make a function and pass part of the statement as argument
function ExampleFunction( argument ) {
...
0
votes
4answers
44 views
Javascript if statement with AND and OR
I'm using a browser plugin for jQuery that retrieves the browser name and version. Anyway I'm trying to display a message if the user is using a certain browser and/or a certain version. Here is what ...
0
votes
1answer
47 views
'If' statement to change function
I'm trying to add an If statement to change the parameters of the a function for one specific point, however the code seems to apply the first function to all points, regardless of the if statement.
...
0
votes
9answers
67 views
JavaScript if statement
Is there anyway to do this:
if (document.getElementById("x").value == 2 || document.getElementById("x").value == 3) {
//Do somthing
}
# Can I make it simple in some kind a way like ...
0
votes
1answer
55 views
IF statement trouble jQuery
if(jQuery('.hero .contenido .activo').next().length > 0){
jQuery('.hero .mas').click(function(){
jQuery('.hero .contenido').find('.activo').fadeOut('fast');
jQuery('.hero ...
0
votes
2answers
89 views
How do i combine user input change text method and an if statement?
I want to combine these two blocks in the script. I want it so that when you type river into the text box i can give a good job statement or post a link.
I don't know what to use as the variable in ...
0
votes
4answers
86 views
If statement not work jquery
I have this url:
csumb/index.php?page=consultanta
I try to compare 2 links but this code do the same thing if I change my link and I refresh the page.
var pathname = window.location.pathname;
...
0
votes
3answers
93 views
Uncaught SyntaxError: Unexpected token }
I have the following script, which returns me the following error in my console:
Uncaught SyntaxError: Unexpected token }..
The } in between ** is the one causing the problem according to my ...
1
vote
5answers
4k views
if variable contains [duplicate]
Possible Duplicate:
JavaScript: string contains
I have a postcode variable and want to use JS to add a location into a different variable when the postcode is changed/entered. So for ...
0
votes
4answers
115 views
If-else statement is not working, would like to ignoreCase in JavaScript
Everything else on my page works perfectly. The alert(userinput.value); works perfectly... but the statements do not call the button. The code only returns the valid commands in the else statement.
...
0
votes
1answer
126 views
In Javascript, what is the difference between a statement and an expression?
I asked this question earlier, and after thinking about the topic some more, I began to wonder where the seemingly fuzzy boundary between the meanings of the terms "statement" and "expression" lies. ...
2
votes
3answers
86 views
Simplify this If statement so it doesn't duplicate code - Javascript
I have an If statement that runs within a 'for' loop to create markers for a Google map. Basically if a tick box is not ticked it runs the code all displays all markers, but if a checkbox is ticked ...
0
votes
2answers
55 views
javascript mixing numbers and strings in a single statement
I want to change a number to a string like this:
var i = slides.length*100;
i += '%';
el.style.height = i;
But I see that I could also do it all in one statement:
el.style.height = ...