代码之家  ›  专栏  ›  技术社区  ›  amorfis

rich:jQuery不是处理JS呼叫

  •  1
  • amorfis  · 技术社区  · 14 年前

    <rich:jQuery timing="onJScall" name="updateUrlHash" selector="#conversationId" 
        query="alert('in jquery call');" />
    

    然后我有一些a4j:commandLink,它应该在完成ajax请求时调用函数。

    <a4j:commandLink value="test" oncomplete="updateUrlHash(this)" />
    

    不幸的是,它不起作用。我知道oncomplete是有效的,因为如果我把 alert('test'); updateUrlHash 功能,它不工作。我在页面源代码中检查了函数是否存在。有什么问题吗?

    1 回复  |  直到 14 年前
        1
  •  1
  •   amorfis    14 年前

    jQuery(selector).alert('in jquery call');
    

    这当然行不通。所以我需要调用所选元素上的任何内容,然后我可以做我想做的:

    query="hide(); alert('this works');"
    

    jQuery(selector).hide(); alert('this works');