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 4th, 2014, 02:39 PM
Registered User
 
Join Date: Sep 2014
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Hello World (Chapter 3) not working

Hi, I recently bought the book and am trying to get the hello world app (chapter 3) to work. I have downloaded all the code and it seems to run fine per chrome JS debugger, except that connecting to a server doesn't work. I am using the standard bosh server in code http://bosh.metajack.im:5280/xmpp-httpbind and try to connect to either jabber.de or alpha-labs.net, both of which I have an account on which works with pidgin on W7 x64. However, in the Hello app, nothing happens, not even the log is written to via jQuery.

For example, my jid is [email protected], so I enter this into the jid field, along with the correct pw. nothing happens.

Thanks for any and all help!

Cheers,

Chris
 
Old October 22nd, 2014, 06:59 PM
Authorized User
 
Join Date: May 2013
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Default

it helps if you have some code to show us. No one can figure out what's wrong with your code if we can't see what you wrote in the first place. Here's a stripped down version of chapter 3 which I put together and it works.

Code:
<!DOCTYPE html>
<html>
  <head>
    <title>Hello - Chapter 3</title>
    
    <script type = "text/javascript" src="http://code.jquery.com/jquery-latest.js"> </script>



    <!--include JQM-->
    <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1"> 
    <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 flxhr-->

    <script src='js/scripts/strophe1.1.3.js'></script>
    <script src='js/scripts/flXHR.js'></script>




    <link rel='stylesheet' href='hello.css'>

    <script src='hello.js'></script>


  </head>
  <body>
    <h1>Hello</h1>

    <div id='log'>
    </div>

    <!-- login dialog -->
    <div id='login_dialog' class=''>
      <label>JID:</label><input type='text' id='jid' value = 'your_jid'>
      <label>Password:</label><input type='password' id='password' value = 'your_password'>
      <button>Submit</button>
    </div>
  </body>
</html>

and here is the hello.css

Code:
body {
    font-family: Helvetica;
}

h1 {
    text-align: center;
}

.hidden {
    display: none;
}

#log {
    width:350px;height:400px;color:red;border:1px solid black;
}
Note that I'm using the latest version of strophe (1.1.3) which can be downloaded from github. The version used in the book is much older but also works. If you just want to keep things simple, use the version from the book. You can find it archived here on p2pwrox. Same goes for the flxhr. Goodluck





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 3 and the real world Antonius Block BOOK: Beginning ASP.NET 4.5 : in C# and VB 1 May 16th, 2013 03:56 AM
Chapter 1 Question Hello World A725859 BOOK: Beginning Android 4 Application Development 9 October 3rd, 2012 05:12 PM
chapter 3 hello world; status 1 only reternalmemory BOOK: Professional XMPP Programming with JavaScript and jQuery 1 September 13th, 2012 08:35 AM
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.