Javascript Definition and 73 Threads
-
M
Java Why Doesn't the JavaScript Power Function Work?
write an if statement that checks if the parameter exponent is 0. If it is, return 1 (a base case). var power = function(exponent, base){ if (exponent === 0){ return 1; } }; power(); It does not work, ca anyone tell why?- mindauggas
- Thread
- Function Javascript
- Replies: 1
- Forum: Programming and Computer Science
-
M
Java [Javascript?] help with functions: isOdd in terms of isEven
Problem statement: Define isOdd function, and then define isEven function in terms of isOdd function. My attempt is ridiculous: var isOdd = function (x){ if (x % 2 ===0){ return isOdd; }else{ return "is even"; } }; var isEven = function (){ return; };- mindauggas
- Thread
- Functions Javascript Terms
- Replies: 13
- Forum: Programming and Computer Science
-
M
Java [Javascript?] Using a function as an argument for another function
var square = function (x) { return x * x; }; var cube = function (x) { return square * x; }; This is my shot, its not right. Please indicate or suggest the correct answear. :)- mindauggas
- Thread
- Argument Function Javascript
- Replies: 12
- Forum: Programming and Computer Science
-
M
Java JavaScript arrays and loops combination question
var lost = [4, 8, 15, 16, 23, 42]; var count = lost.length; var isLost = function (n) { for (i=lost[0]; i<count; i=lost[i+1]) { if ( n === lost[i]) { return "true"; } } return "false"; }; is it possible to in corporate array positions into the for loop? (i) do...- mindauggas
- Thread
- Arrays Combination Javascript Loops
- Replies: 3
- Forum: Programming and Computer Science
-
M
Java JavaScript crashes while squaring number
Is this a legit code for printing out squares of numbers betwean 100 and 150 ? Seems to crash everytime. for (var i=100; i<151; i*i) { var square = i; console.log(square); } Need help :)- mindauggas
- Thread
- Javascript
- Replies: 4
- Forum: Programming and Computer Science
-
A
Java Understanding Array Initialization in JavaScript
The general form for creating an array is: Myarray=new arrayname(); But I don't understand wht should I type in the name of the array twice? Because I thought Myarray and arrayname is the same.- AllenHe
- Thread
- Javascript
- Replies: 1
- Forum: Programming and Computer Science
-
M
Java Lognormal cumulative distribution function for JavaScript?
Hey everyone! I'm building a "Deal or No Deal" calculator that estimates the odds of getting a better deal than the one presented. As you can see in the title, I'm looking for a function that will calculate the CDF. For ease's sake, please only post JavaScript code (no C,Perl,BASIC,etc.)- moonman239
- Thread
- Distribution Distribution function Function Javascript
- Replies: 6
- Forum: Programming and Computer Science
-
P
Comp Sci JavaScript Problem: Code Access Between Frames
Homework Statement I'm required to make a page that has the following format: Left Frame Items with prices and check boxes next to them An "Update Order" button at the bottom so the order details on the Right Frame can be updated. Right Frame A "receipt" form with all the...- prosteve037
- Thread
- Code Frames Javascript
- Replies: 7
- Forum: Engineering and Comp Sci Homework Help
-
J
Java Javascript - Reducing a number to smaller numbers
I am looking for advice on how to approach a problem. I would like to take a given number and break it into 7 parts. For example, the function call, BreakIntoSmallerNumbers(15); would return the following array: [3, 2, 2, 2, 2, 2, 2] BreakIntoSmallerNumbers(3); returns [1, 1, 1]...- jonesrussell
- Thread
- Javascript Numbers
- Replies: 11
- Forum: Programming and Computer Science
-
Java Adobe Acrobat 9: Javascript: Merge Odd/Even Pages
Hey folks I don't know if anyone can help with this, it should be straightforward though. I have a 2 PDF documents called Doc1.pdf and Doc2.pdf. Doc1 contains all of the odd numbered pages of a main document and Doc2 contains the even ones. I would like to merge the Doc2 even pages into Doc1...- Saladsamurai
- Thread
- Javascript
- Replies: 1
- Forum: Programming and Computer Science
-
K
Java Build a Complex JavaScript Calculator
Hi guys. I am mechanical engineering undergraduate and we have a website. Now we want to put up an interactive calculator on our website. So we are trying JavaScript. Though we tried writing a code for our calculator it didn't work. At this time we're getting confused because of level of...- koolraj09
- Thread
- Calculator Javascript
- Replies: 1
- Forum: Programming and Computer Science
-
T
HTML/CSS Where can I find free online resources to learn HTML, Javascript, and CSS?
I am trying to learn these web designing stuff on my own and am currently using http://www.w3schools.com/html/default.asp for HTML learning... and though i am well aware of the basics ..i need to know much in depth. So do you guys have any good 'n' free online resources to learn HTML +...- The legend
- Thread
- Css Html Javascript
- Replies: 11
- Forum: Programming and Computer Science
-
K
Java Gaint Cursor in JavaScript, Framing Pandora (for visually impaired user)
My brother is low vision and I wanted to create a web page on our local computer that will use a large cursor in JavaScript (I've heard this is possible) while being a frame around the pandora radio website, to make is easier for him to see the cursor. Alas, most of my programming experience...- k_squared
- Thread
- Javascript
- Replies: 1
- Forum: Programming and Computer Science
-
C
Java Is there a javascript or php code to remove browsing history?
I want to remove my clients browsing history every time they access new pages from my website. is there any code, i keep searching the net and i can't find one.- chrisalviola
- Thread
- Code History Javascript Php
- Replies: 2
- Forum: Programming and Computer Science
-
T
Java I am stuck with a little javascript problem
I am using scripting my webpage's tabs I have 5 tabs and I'd like the tab animation I am learning to make a selected tab to be... a selected tab. I'd like this to be done in css I'd like the mouse pointer not to be changed into a hand when the mouse is over the selected tab. That's it I mean...- ToonCare
- Thread
- Javascript Stuck
- Replies: 1
- Forum: Programming and Computer Science
-
R
Comp Sci Generate Random Images with JavaScript: Basic Program Help Needed
Homework Statement I'm supposed to write a program that upon clicking a command button generates a random number, and displays 1 of 7 images that is associated with the random number generated. Ive been at this for a few hours and can't get the image to change. EDIT: Upon further testing it...- renob
- Thread
- Javascript Program
- Replies: 8
- Forum: Engineering and Comp Sci Homework Help
-
G
Java Can JavaScript Bookmarklets Modify Text Selections and Clipboard Contents?
can one write a javascript bookmark that will print a single unicode character (like a smiley face or a math symbol) to the clipboard (or better still straight to the cursor position)? how about print something like (SUB) to the clipboard then append what is highlighted to the clipboard then...- granpa
- Thread
- Javascript
- Replies: 2
- Forum: Programming and Computer Science
-
U
Java Mixing blogs using javascript or other means
Is it possible with javascript to take one article from blog A, one article from blog B, one article from blog C, and show them all together in one big table, with one article per table cell? Even better, is it possible to mix blogs as above but without duplicating content on an intermediate...- Ulysees
- Thread
- Javascript Means Mixing
- Replies: 23
- Forum: Programming and Computer Science
-
Java How can I hide DIVS with JavaScript on page load?
I have some divs on a web page, with the class name "hans" which I would like to hide with JavaScript when the page loads. The reason I have it set up this way is so that the user can reveal the div's by clicking a link, but if JavaScript is disabled, the div's will be displayed by default...- Hootenanny
- Thread
- Javascript
- Replies: 10
- Forum: Programming and Computer Science
-
Java Frontpage JavaScript: Understanding the Code Block
I'm looking at this site that I may need to modify. It was built in Frontpage. I'm not familiar with FP. There's a block of code the top like this: [FONT="Courier New"]<SCRIPT type="text/javascript"><!--...- DaveC426913
- Thread
- Javascript
- Replies: 3
- Forum: Programming and Computer Science
-
Java How can I add a Deep Impact countdown to my forum signature using Javascript?
I was wanting to have a simple copy of the Deep Impact countdown on my signature in another forum. I've really been racking my brain trying to figure this out, and to no avail. http://www.space.com/deepimpact/ any help would be GREATLY appreciated. B. Elliott- B. Elliott
- Thread
- Javascript
- Replies: 6
- Forum: Programming and Computer Science
-
V
Java Learn How to Create a Custom JavaScript Message Box | Step-by-Step Guide
When my users click a button or a link etc, to get out or to get known what I would like to tell them, they will always see "Javascript Application" and below it is my message written. Now, I would completely[/color] be able to GET IT OUT OFF MY MESSAGEBOX, that TITLE[/size]...How can I make...- Vance
- Thread
- Box Javascript
- Replies: 3
- Forum: Programming and Computer Science
-
I
Java Trouble Submitting Form with JavaScript
I'm having trouble sumbitting a form using javascript. The form has a submit button (type=button) that used to be type=submit. i have change it's properties so that it now calls a function that later submits the information. the problem I'm having is that when i click the submit button the...- incognito-41
- Thread
- Form Javascript
- Replies: 1
- Forum: Programming and Computer Science