作者:手机用户2602930645 | 来源:互联网 | 2023-05-27 08:50
public static native void doConnect() /*-{
$wnd.jQuery(document).trigger('connect',
{
jid: 'sss',
password: 'sss'
}
);
}-*/;
i tried the above ,but there is no error in firebug or gwt hosted mode console(so i cannot know whether the code is success or not). may i know is this the correct way to call jquery trigger? but when i put alert() in bind('connect'), it was not called
我尝试了上面的方法,但是在firebug或gwt托管模式控制台中没有错误(因此我不知道代码是否成功)。请问这是调用jquery触发器的正确方式吗?但是当我在bind('connect')中输入alert()时,它没有被调用
inside .js file
$(document).bind('connect', function (ev, data) {
alert('not call.....at all');
var cOnn= new Strophe.Connection(
"http://bosh/xmpp-httpbind");
conn.connect(data.jid, data.password, function (status) {
if (status === Strophe.Status.CONNECTED) {
$(document).trigger('connected');
} else if (status === Strophe.Status.DISCONNECTED) {
$(document).trigger('disconnected');
}
});
Hello.cOnnection= conn;
});
2 个解决方案