Wrox Programmer Forums
|
BOOK: Beginning JavaScript
This is the forum to discuss the Wrox book Beginning JavaScript by Paul Wilton; ISBN: 9780764544057
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning JavaScript 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 October 21st, 2009, 09:35 AM
Authorized User
 
Join Date: Jan 2009
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default Scrolling status bar

The code for scrolling status bar in chapter 9 didn't work. please help me with a working code.
 
Old October 22nd, 2009, 06:35 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Most of us won't have that beginner's book. If you want help with the code, then show the code.
 
Old October 23rd, 2009, 06:17 AM
Authorized User
 
Join Date: Jan 2009
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default Scrolling status bar

Thanks Old pedant .I tried it but it didn't work. here is the code

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript" type="text/javascript">
var message = "Beginning JavaScript from Wrox Press";
var startChar = 0;
var maxLength;

function window_onload()
{
var availWidth = 0;
var spaces = "";
if (typeof window.innerWidth != 'undefined')
{
availWidth = window.innerWidth / 10;
}
else
{
availWidth = document.body.scrollWidth / 10;
}
while (availWidth > 0)
{
spaces = spaces + " ";
availWidth--;
}
message = spaces + message;
maxLength = message.length - 1;
setInterval("scrollMessage()",65);
}
function scrollMessage()
{
window.status = message.substring(startChar);
startChar++;
if (startChar == maxLength)
{
startChar = 0;
}
}
</SCRIPT>
</HEAD>
<BODY LANGUAGE=JavaScript onload="return window_onload()">
<P>Scrolling Status Bar Example</P>
</BODY>
</HTML>
 
Old October 23rd, 2009, 03:38 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

It works fine in MSIE.

Chrome doesn't have a status bar, and FireFox blocks changes to window.status by default (the user must change permissions to allow it to be used). It's a very very old script, so I would guess it only works in MSIE and old versions of Netscape Navigator.
 
Old October 23rd, 2009, 04:23 PM
Friend of Wrox
 
Join Date: Jun 2008
Posts: 1,649
Thanks: 3
Thanked 141 Times in 140 Posts
Default

Yeah, it says that edition of the book is from year 2000. FireFox and Chrome weren't even close to existing back then. It was intended for MSIE 4 and Netscape 4. You're going to encounter some pretty old and creaky code in that book, so take it with a grain of salt. *PROBABLY* you will find the most compatiblity with MSIE. MSIE version 7 still supports most all the stuff the MSIE 4 did, but you can't say that about most other browsers. I know, I know...you hate MSIE. Hard to blame you, but if you use that book you might not have a better choice.
 
Old October 29th, 2009, 12:17 PM
Authorized User
 
Join Date: Jan 2009
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
Default Scrolling status bar

Thanks a lot Old pedant.
Pls, can you help me with the scrolling text code that works with Firefox or that is cross-browser.





Similar Threads
Thread Thread Starter Forum Replies Last Post
scrolling bar for a webpart mahesh_sharepoint SharePoint Development 3 January 21st, 2013 06:01 AM
Status Bar ironchef Java GUI 0 October 26th, 2006 09:19 PM
Change Status bar qazi_nomi HTML Code Clinic 1 July 10th, 2004 04:28 PM
Status Bar soccers_guy10 Pro VB.NET 2002/2003 3 August 12th, 2003 11:48 PM





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