/    Sign up×
Community /Pin to ProfileBookmark

Javascript calls twice

I have a web-based AJAX Calendar I’m working on.
It’s similar to Google’s Calendar in some functionality.
I have an onclick function on the cell containing the date and if there is an event on that date, there is an onclick function on that event. The event is contained within the cell, such as

[CODE]<td onclick=”dosomething();”><a href=”#” onclick=”dosomething();”>Some Event</a></td>[/CODE]

Although it’s a little more complicated than that with the PHP code and db calls.
Anyway, if I click on the empty part of the cell, it calls the first function which displays an edit box similar to Google’s Calendar.
If I click on the link, it calls both functions and sometimes displays the event details or sometimes the edit box. I know this because of Firebug in Firefox.
Anyway, how can I only call the function once.

Thanks for you help. If you need more info, let me know.

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @ccoppenbarger 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.19,
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,
)...