/    Sign up×
Community /Pin to ProfileBookmark

quick question

<a href=”#” onclick=”javascript:togglemc();return false;” id=”lcmanage”><?php echo $this->_MT_LANG->MANAGE; ?></a>

I have very little knowledge of javascript. The above code shows up as a link that slides down a little window when a user clicks on it.

Instead of having to click on a link, is there a way to alter this so it automatically happens when the page loads?

Thanks

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@cbVisionOct 28.2008 — I believe what it's doing is calling the togglemc() function when the link is clicked. You could simply call the function in the header of that page:

<script type="text/javascript">togglemc();</script>

The above line should be placed between the <head></head> tags.
Copy linkTweet thisAlerts:
@ZeroKilledOct 28.2008 — placing code in the header that interact with the document may throw error. if the so called window is a window object (the object returned by window.open method), then is ok to call the function in the header. but if the window is a window simulation (an element in the document), then you have to wait until that window is created on the document so you can use the function without problem:

window.onload = togglemc;
×

Success!

Help @alturn 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.18,
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,
)...