在小窗口中打开,并可以执行action
<script>
function addToBag()
{
window.open("#","successToBag","height=300,width=200,toolbar=no,menubar=no,scrollbars=yes");
document.getElementById("bookForm:addBookBag").click();
}
</script>
<div style="display: none;">
<h:commandLink value="放入书架" target="successToBag" id="addBookBag" action="#{bookBagBean.addBookBag}">
<f:param value="#{bookBean.book.bookid}" name="bookid"></f:param>
</h:commandLink>
</div>
<a href="#" οnclick="addToBag();">放入书架</a>