Calling an agent using javascript

Hi all,

I’m new to web development. and got a work on click of a hotspot button some action action to be performed. i wrote the needed functionality in an agent.Its working fine in client.

i need to call that agent in that button.

i cant use formula/lotus script, bcos already one more function is calling from the same button.

for ex: names1(ca, …) function already exists in the button.

Now , i added …

Path=“/”+document.forms(0).DB_Name.value+“/agent1?Openagent”;

alert(Path);

//location.href = path

It displays the complete path after execution of the first function bcos of alert. if i use …

location.href = path

agent is working, but complete window is getting refreshed with the url in the path.

suggest me…how to call the agent to run in the same window…

thanks in advance…

Subject: calling an agent using javascript

create a hidden action (button) on the same form, with the @Command([ToolsRunMacro]; “YourAgentName”)

in the HTML tab of the action button give it a name such as: UpdateNow infront of style enter disply=none to hide it.

now from your javascript you can simply use the following code:

var f = document.forms[0];

f.UpdateNow.click();

Subject: calling an agent using javascript

Try opening a pop-up window from the main window. In pop-up window call the agent. Once the agent finishes close it and come back to main window. In java script you can communicate between parent and child windows.

Regards

Byju Joy