The Cellar  

Go Back   The Cellar > Main > The Internet
FAQ Community Calendar Today's Posts Search

The Internet Web sites, web development, email, chat, bandwidth, the net and society

Reply
 
Thread Tools Display Modes
Old 11-14-2005, 03:06 PM   #1
laebedahs
Abecedarian
 
Join Date: Oct 2005
Posts: 172
It's been a while since I've messed with javascript, but I believe you're making it too hard.

Let's start with the function you want to return the value from first.

function function1() {
statements;
// here's the important part: whatever you want to be able to be used in another function or statement, you need to "return" it
return blahblah;
// so if you have a variable named "blahblah" that you stored some info in, it will return that.
}

// here's the second function

function function2(blah) {
document.write(blah);
}

Now... you can pass the first function to the second function like this:

function2(function1());

You can also pass variables/data to the first function like you normally would. You can also return boolean values, such as TRUE or FALSE.
laebedahs is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -5. The time now is 12:41 AM.


Powered by: vBulletin Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.