/    Sign up×
Community /Pin to ProfileBookmark

problem with object!

Code:
function fa(object1) {
// my code

}

function fb() {
// my code

}
<textarea id=”t1″ onclick=”fa(this)”> 111 </textarea>

What should I do to use object1 in function fb()?
Please help me,
Thanks

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@sridhar_423Aug 29.2006 — var gl; // Global variable

function fa(object1){

gl=object1

//some code

}

function fb(){

//use gl here.

}
Copy linkTweet thisAlerts:
@CrazyMerlinAug 29.2006 — where is fb being called from?

if it is being called from inside fa, try:
<i>
</i>condition = function(object1){ fb(object1); }


object1 is then passed into the 'grace' function and made accessible to fb.

a grace function is just a pssing function.

I don't know if the term grace function actually exists, but in music if you want to get from one note to another without perceptive interupt in pitch, you use a 'grace' note.

So if the term 'grace function' does not already exist, I am coining it now. ?

Merlin!

note: or as sridhar posted while I was posting...you could also make the object global.
Copy linkTweet thisAlerts:
@minhkhoiauthorAug 29.2006 — var gl; // Global variable

function fa(object1){

gl=object1

//some code

}

function fb(){

//use gl here.

}[/QUOTE]


Thanks, successful

I can't understand. I have done like above many many times, but not successed, I asked myself:" What happened, It really exactly"

Now, successed. Can't understand :eek:
Copy linkTweet thisAlerts:
@sridhar_423Aug 29.2006 — u might have overlooked some part "many times" which is declaring global variables. If not, u might have used merlin's approach in accessing "object1" in fb().
Copy linkTweet thisAlerts:
@minhkhoiauthorAug 29.2006 — Thanks, may be I have some mistake
×

Success!

Help @minhkhoi spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...