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 March 13th, 2014, 03:22 PM
Registered User
 
Join Date: Feb 2014
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
Default issue with tabs, jQuery UI

Hi all

I am working with the chapter 6 code.

www.arialboundaries.com/chatting


Parts are working..however, I cannot send a message to a user.

Looking at firebug, the issue seems to be that the add method is deprecated for JQuery UI (I got an errror, no such method add method for tabs widget instance.

I tried to substitute add with append in the javascript (gab.js) but that did not work either...anyone know what I need to substitute to get this to work?

If I have identified the wrong problem, please let me know...thanks!

Michael
 
Old March 13th, 2014, 03:30 PM
Wrox Author
 
Join Date: Jan 2010
Posts: 178
Thanks: 0
Thanked 16 Times in 15 Posts
Default

It looks like in newer jQuery UI you have to add the HTML dynamically and then call tabs("refresh"). They seem to have removed the old behavior completely.

Alternatively you could just use the older version of jQuery UI.
 
Old March 13th, 2014, 04:13 PM
Registered User
 
Join Date: Feb 2014
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi
I went to a lower version of JQuery UI...it works..I can add a person, and start a chat a session, but...the text does not seem to be sending for some reason:

http://www.arialboundaries.com/chatting

I can type text into the field, but it won't post to chat area...
 
Old March 13th, 2014, 04:26 PM
Wrox Author
 
Join Date: Jan 2010
Posts: 178
Thanks: 0
Thanked 16 Times in 15 Posts
Default

I won't be able to help without some more specific information like the error message in the console, etc.
 
Old March 13th, 2014, 04:36 PM
Registered User
 
Join Date: Feb 2014
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi
The strange thing is I don't see an error message in the console...

I see a couple, but they refer to deprecated code in the lower version of jquery UI and jquery...

I can get a message through the UI, but can't send one...I really don't see any obvious errors (I am using firebug, Google Chrome, and the built in inspector in Firefox).

Thanks for trying to help
Michael
 
Old March 13th, 2014, 04:39 PM
Wrox Author
 
Join Date: Jan 2010
Posts: 178
Thanks: 0
Thanked 16 Times in 15 Posts
Default

Use the strophe logging stuff (see ch 3,4 I think for examples), and see if the message is getting sent and just getting lost somewhere.
 
Old March 13th, 2014, 05:04 PM
Registered User
 
Join Date: Feb 2014
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Hi
I am looking at the error log; I don't see any messages...I can see authentications, when new users are subscribed to, those things are happening...it's almost as if there is no submit action happening...
 
Old March 13th, 2014, 06:19 PM
Registered User
 
Join Date: Feb 2014
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
Default Okay, I got it...but not sure how to fix

I now remember that, before I was getting this error in the console:

TypeError: $(...).live is not a function

So I replace instances of live with on, as that seemed to be the way to rewrite this code.

Even going down versions of JQuery, I still get this error message...but maybe the "on" method is not doing something similar to live?

I am still looking, but I think I am on to something...
 
Old March 13th, 2014, 10:22 PM
Wrox Author
 
Join Date: Jan 2010
Posts: 178
Thanks: 0
Thanked 16 Times in 15 Posts
Default

You want delegate(): http://api.jquery.com/delegate/
 
Old March 13th, 2014, 10:42 PM
Registered User
 
Join Date: Feb 2014
Posts: 9
Thanks: 1
Thanked 0 Times in 0 Posts
Default

not to be obtuse, but something like this:

$('.chat-input').delegate('keypress', function (ev) {


It just seems the enter key is not registering...but there could be something larger going on..





Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch16 (tabs) corrections for later jQuery versions rod.walsh BOOK: Beginning JavaScript and CSS Development with jQuery 0 May 4th, 2012 04:33 AM
IE 7/jquery 1.4.2 checkbox issue PeterPeiGuo BOOK: Beginning JavaScript and CSS Development with jQuery 8 May 16th, 2010 04:05 PM
Menu Tabs jabwedll BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio 0 April 19th, 2010 01:28 PM
Jquery issue FileFound Javascript How-To 0 December 28th, 2009 07:00 AM
Tabs dkr72 C# 1 December 3rd, 2004 02:42 PM





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