Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0
This is the forum to discuss the Wrox book Professional JavaScript for Web Developers by Nicholas C. Zakas; ISBN: 9780764579080
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 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
  #1 (permalink)  
Old July 27th, 2007, 04:37 PM
Registered User
 
Join Date: Jul 2007
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chap8, Browswer Detection,detect.js, Problem!Help

Hi,
    I hope this query is relevant since its the problem from NZ's Book.

    I am trying to run the example code. Chap 8.
    I am using LINUX,(UBUNTU) and FF 2.0.0.5.

    I am not getting the login screen.
    I am getting the 'divError' screen.

what should I add in this ? Where am I wrong?
Thank you,
Prasad.

  #2 (permalink)  
Old July 27th, 2007, 05:28 PM
Registered User
 
Join Date: Jul 2007
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I played for some time...and got the following code to work on Linux Box.

// the following Line in detect.js
var isLinux = (sUserAgent.indexOf("Linux") > -1) && !isWin && !isMac;

// Modifying the following Line in Login.htm

if ((isMinIE5_5 && isWin) || (isMinMoz1 && isUnix)

to

if ((isMinIE5_5 && isWin) || (isMinMoz1 && (isUnix || isLinux) )

This served my purpose and it hopefully is generic for all Linux boxes irrespective of whether they are 686, 586, 486 or 86_64...etc.

thanks.
Prasad.

  #3 (permalink)  
Old July 27th, 2007, 05:40 PM
Registered User
 
Join Date: Jul 2007
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

To make login work on Konqueror on a Linux BOX,
modify the following line:

if ((isMinIE5_5 && isWin) || (isMinMoz1 && (isUnix || isLinux) )

to

if ((isMinIE5_5 && isWin) || ((isMinMoz1||isKHTML) && (isUnix || isLinux) )

thanks.
for the book.
prasad.

  #4 (permalink)  
Old July 30th, 2007, 12:24 AM
nzakas's Avatar
Wrox Author
 
Join Date: Dec 2004
Location: Peabody, MA, USA.
Posts: 217
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Hi,

I can't be sure why it's not working for you. If you can post the user agent string that your browser is reporting, I can take a look. Right now, isUnix is keyed off of the "X11" string in the user agent. If that's not there, it wouldn't work.

Nicholas C. Zakas
Author, Professional JavaScript for Web Developers (ISBN 0764579088)
http://www.nczonline.net/


Similar Threads
Thread Thread Starter Forum Replies Last Post
Zxml.js and input radio problem tezro BOOK: Professional Ajax ISBN: 978-0-471-77778-6 3 December 8th, 2007 05:19 PM
Problem about replacement of already loaded js helpless_freshman Javascript 7 August 31st, 2007 08:14 PM
No Login/Is it a Bug in detect.js burrashiva BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 0 July 27th, 2007 03:57 PM
TAPI 3.0 : Problem in Digit Detection Qaisar Visual C++ 0 March 10th, 2006 09:54 PM
Problem in printing Document in JS... sweetee JSP Basics 0 May 22nd, 2004 01:10 AM





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