Wrox Programmer Forums
|
BOOK: Professional XMPP Programming with JavaScript and jQuery
This is the forum to discuss the Wrox book Professional XMPP Programming with JavaScript and jQuery by Jack Moffitt; ISBN: 978-0-470-54071-8
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional XMPP Programming with JavaScript and jQuery section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 15th, 2014, 04:06 PM
Authorized User
 
Join Date: May 2013
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default Anyone successfully used strophe.register.js?

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>





Similar Threads
Thread Thread Starter Forum Replies Last Post
Has anyone successfully used Strophe.Status.DISCONNECTING object? drayarms BOOK: Professional XMPP Programming with JavaScript and jQuery 1 July 20th, 2014 12:10 PM
XMPP Strophe JS Best Practice wlazuardi BOOK: Professional XMPP Programming with JavaScript and jQuery 3 December 13th, 2013 02:02 PM
Register XMPP-Account using the Strophe.js-Register-Plugin ede32 BOOK: Professional XMPP Programming with JavaScript and jQuery 3 January 27th, 2013 01:55 PM
Issues with strophe register plugin Milo1999 BOOK: Professional XMPP Programming with JavaScript and jQuery 0 December 2nd, 2012 12:34 PM
Using sha1 passwords in Strophe.js semper BOOK: Professional XMPP Programming with JavaScript and jQuery 1 June 28th, 2010 02:15 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.