我正在尝试使用 strophe 插件在 openfire 服务器上注册一个新用户,但它没有连接注册。这里的描述https://github.com/metajack/strophejs-plugins/tree/master/register并没有让我更进一步:(我必须先建立连接吗?这是我在单击按钮时尝试的登记:
$("#RegButton").click(function () {
var callback = function (status) {
if (status === Strophe.Status.REGISTER) {
connection.register.fields.username = "juliet";
connection.register.fields.password = "R0m30";
connection.register.submit();
} else if (status === Strophe.Status.REGISTERED) {
console.log("registered!");
connection.authenticate();
} else if (status === Strophe.Status.CONNECTED) {
console.log("logged in!");
} else {
// every other status a connection.connect would receive
}
};
connection.register.connect("http://localhost:7070/http-bind/", callback);
});