Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

JavaScript Forum


You are currently viewing our JavaScript Forum as a guest. Please register to participate.
Login



Reply
Help with passing no arguments
Old 04-24-2007, 08:42 PM Help with passing no arguments
Super Talker

Posts: 116
Trades: 0
Hi all,

I really need some help right now. I wrote a function for my new job that I placed into 15 pages.

Here is the function...

function swapFLSText(lcText) {
if (fls_user) // condition to change the text
{
var newbody = document.getElementById(lcText)
var newtext = "the Financial Life Team";
newbody.innerHTML=newtext;
}
}

Well, guess what. I'm passing a lower case "t" in "the" and I came across a change that it's the BEGINNING of a sentence.

I could just rewrite a swapFLSText2() to pass the innerHTML with the "The Financial Life Team"....

But I'm wondering with all the great minds in CyberSpace... if I passed a second argument in the newer version, how could I check for the undefined in JavaScript that would still let the swapFLSText(lcText) work without having to go back into 15 pages to change it for a second parameter.

Does this make sense?

DonnaZ
DonnaZ is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-24-2007, 09:02 PM Re: Help with passing no arguments
ADAM Web Design's Avatar
Canadastaninianite

Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades: 0
Code:
if ([second argument here] == undefined) {
 
}
That may do what you want.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
(my blog)


Please login or register to view this content. Registration is FREE
(with proof)
ADAM Web Design is offline
Reply With Quote
View Public Profile Visit ADAM Web Design's homepage!
 
Old 04-26-2007, 04:41 PM Re: Help with passing no arguments
Super Talker

Posts: 116
Trades: 0
Adam,

Thanks

DZ
DonnaZ is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Help with passing no arguments
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11311 seconds with 12 queries