calling Action method of a commandbutton from java script

hi all,can anyone tell me how to call action method of a commandbutton from java script.The action method in the backing bean prepares and returns a url which needs to be opened in a new browser window.any help appreciated
[250 byte] By [srinivas-jsfa] at [2007-10-3 1:48:26]
# 1
Dodocument.getElementById('idOfCommandButtonOrCommandLink').click();
BalusCa at 2007-7-14 18:46:48 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...