Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > BOOK: Professional XMPP Programming with JavaScript and jQuery
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old September 4th, 2014, 02:39 PM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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 justatest@jabber.de, so I enter this into the jid field, along with the correct pw. nothing happens.

Thanks for any and all help!

Cheers,

Chris
  #2 (permalink)  
Old October 22nd, 2014, 06:59 PM
Authorized User
Points: 182, Level: 3
Points: 182, Level: 3 Points: 182, Level: 3 Points: 182, Level: 3
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 09:07 PM



All times are GMT -4. The time now is 04:48 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.