I have a page where users see this anchor…
<a href="javascript:launchSomething("1", "2", "1")">Test</a>
Is it possible to execute/call launchSomething(.....) function without having the user to click it? If the params were fixed values then I could just do something like …
//on document.ready() {
// launchSomething( .... );
//}
but the web page is generated dynamically and these params change too so what do I need to do to trigger it automatically once the web page has loaded?
thanks for help.
UPDATE
I have just got the markup changed to
<a class="click1" href="javascript:launchSomething('1', '2', '1')">Test</a>
so it always has a class “click1”
You can do this by dynamically generating an attribute for your links:
You can then bind this as the click handler for your link:
To invoke the handler for a specific link, you could use: