I'm trying to use the strophe.register.
js plugin from github
https://github.com/strophe/strophejs...aster/register to do in-band registration. When I load my page, I get the following error
'undefined' is not an object (evaluating 'conn.authenticate.bind')
This error occurs on line 86 of strophe.register.
js
Has anyone know about about hacks to fix this or has anyone successfully used this plugin?
Here's the code I have so far
Code:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type = "text/javascript" src="http://code.jquery.com/jquery-latest.js"> </script>
<!--JQ mobile -->
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.0-rc.1/jquery.mobile-1.3.0-rc.1.min.css" />
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.0-rc.1/jquery.mobile-1.3.0-rc.1.min.js"></script>
<!--include strophe and associated libraries/plugins-->
<script src='path/strophe.js'></script>
<script src='path/strophe.register.js'></script>
<script src='path/scripts/flXHR.js'></script>
<script>
$(document).ready(function(){
var user = "user;"
var password = "password";
var callback = function (status) {
if (status === Strophe.Status.REGISTER) {
// fill out the fields
connection.register.fields.username = user;
connection.register.fields.password = password;
// calling submit will continue the registration process
connection.register.submit();
} else if (status === Strophe.Status.REGISTERED) {
console.log("registered!");
// calling login will authenticate the registered JID.
//connection.authenticate();
} else if (status === Strophe.Status.CONFLICT) {
console.log("Contact already existed!");
} else if (status === Strophe.Status.NOTACCEPTABLE) {
console.log("Registration form not properly filled out.")
} else if (status === Strophe.Status.REGIFAIL) {
console.log("The Server does not support In-Band Registration")
} else if (status === Strophe.Status.CONNECTED) {
// Say registration was successful
} else {
// Do other stuff
}
};
var connection = new Strophe.Connection("http://bosh.metajack.im:5280/xmpp-httpbind");
connection.register.connect("miqote.com", callback, wait, hold);
});//End document ready
</script>
</head>
<body>
</body>