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 September 12th, 2012, 05:38 AM
Registered User
 
Join Date: Sep 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default chapter 3 hello world; status 1 only

Hello everyone,

I am facing some problem in chapter 3 hello world program.

I used the same code as given in book and run the program. But it is not working exactly as it should be.

When I click connect after entering username and password, “HELLO” is displayed with no other message on the screen

When I checked in firebug, status is shown 1 which is connecting. So line $(document).trigger('connected'); or $(document).trigger('disconnected');
Never gets executed


$(document).bind('connect', function (ev, data) {
var conn = new Strophe.Connection("http://bosh.metajack.im:5280/xmpp-httpbind");
//var conn = new Strophe.Connection("http://<host-domain>:7070/http-bind/"); //line removed. but used for openfire.
conn.connect(data.jid, data.password, function (status) {
if (status === Strophe.Status.CONNECTED) { //,--status = 1 only
$(document).trigger('connected'); //never comes here.
} else if (status === Strophe.Status.DISCONNECTED) {
$(document).trigger('disconnected');
}
Hello.connection = conn;
});
});

In fire bug it shows one error when i load the page.

The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must to be declared in the document or in the transfer protocol.
http://<IP>:3453/xmpp_demo/scripts/flXHR.js
Line 2


I also tried openfire which also resulted in the same result.

Please help.

Last edited by reternalmemory; September 12th, 2012 at 05:52 AM..
 
Old September 13th, 2012, 08:35 AM
Wrox Author
 
Join Date: Jan 2010
Posts: 178
Thanks: 0
Thanked 16 Times in 15 Posts
Default

Try removing the strophe.flxhr.js script and see if it works then. I suspect you've hit some cross domain issue.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 1 Question Hello World A725859 BOOK: Beginning Android 4 Application Development 9 October 3rd, 2012 05:12 PM
I contributed to a chapter on BDD in the Wrox book Real World .NET, C#, and Silverli elbandit BOOK: Professional ASP.NET Design Patterns 0 December 5th, 2011 12:43 PM
Chapter 2: Hello World londo-cat BOOK: Beginning iPhone SDK Programming with Objective-C 1 July 12th, 2010 07:09 PM
Hello World Example Chapter 1 goboomer BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 12 January 14th, 2009 10:07 PM





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