XPage中的Jquery无法正常工作

mik*_*_x_ 5 javascript jquery lotus-notes lotus-domino xpages

我有一个xpage,我已经添加了jquery作为脚本资源.然后我添加了一些控件(编辑,计算,输出脚本与jquery函数),我正在尝试虚拟的东西.看看下面的我的xpage:

<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
    <xp:this.resources>
        <xp:script src="http://code.jquery.com/jquery-1.10.2.js"
            clientSide="true">
        </xp:script>
        <xp:script src="http://code.jquery.com/ui/1.11.0/jquery-ui.js"
            clientSide="true">
        </xp:script>
        <xp:styleSheet
            href="http://code.jquery.com/ui/1.11.0/themes/smoothness/jquery-ui.css">
        </xp:styleSheet>
    </xp:this.resources>

    <xp:scriptBlock id="scriptBlock1">
        <xp:this.value><![CDATA[$(document).ready(function() {
  $("#{id:button1}").mouseover(function() {
      alert('sdfsdfsdf');
  });
});]]></xp:this.value>
    </xp:scriptBlock>
    <xp:br></xp:br>
    <xp:br></xp:br>    
    <xp:button value="Label" id="button1"></xp:button>
    <xp:br></xp:br>
    <xp:br></xp:br>
    <xp:text escape="false" id="ttt">
        <xp:this.value><![CDATA[#{javascript:"<p id='test'>sdfsdfsdf</p>"}]]></xp:this.value>
    </xp:text>
</xp:view>
Run Code Online (Sandbox Code Playgroud)

当我悬停按钮时没有任何反应.如果我将鼠标悬停的ID设置为#test,那么它可以工作.

在XPage中使用jquery有什么问题?

Knu*_*ann 8

使用x $ jQuery选择器从openntf或使用XPages片段

$("[id$='#{id:button1}']").mouseover(function() {...
Run Code Online (Sandbox Code Playgroud)