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.