Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning Dreamweaver MX/MX 2004 MX ISBN: 978-0-7645-4404-0; MX 2004 ISBN: 978-0-7645-5524-4
This is the forum to discuss the Wrox book Beginning Dreamweaver MX by Charles E. Brown, Imar Spaanjaars, Todd Marks; ISBN: 9780764544040
Please indicate which version of the book you are using when posting questions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Dreamweaver MX/MX 2004 MX ISBN: 978-0-7645-4404-0; MX 2004 ISBN: 978-0-7645-5524-4 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 Search this Thread Display Modes
  #11 (permalink)  
Old February 21st, 2005, 11:10 PM
Authorized User
 
Join Date: Jan 2005
Location: , , .
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks!! This is all really new to me, but it is really fun and the book is wonderful! I love being able to follow along and actually DO something, versus just reading about what is supposed to happen.

.. When I tried to do the above, nothing happened... ???

 It just says, "Done, but with errors on page." On the bottom.... I did it while on this website and a new window popped up with the code in it! I can't figure out why it won't work on my page??
Thanks again for putting up with my silly questions!

  #12 (permalink)  
Old February 21st, 2005, 11:14 PM
Authorized User
 
Join Date: Jan 2005
Location: , , .
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I just tried it again, but using Firefox and it worked... I just can't get it to work in IE for some reason...

Here is the JavaScript code from Firefox:
<script language="JavaScript" type="text/javascript">
var sPageName = '/thesoccersite/home.asp';
sPageName = sPageName.substr(sPageName.lastIndexOf('/')
 + 1).toLowercase();
sPageName = sPageName.substr(0, sPageName.lastIndexOf('.'));
if (document.getElementById(sPageName))
{
document.getElementById(sPageName).style.fontweigh t = 'Bold';
document.getElementById(sPageName).style.fontsize = '14pt';
}
</script>

Thanks Again!
  #13 (permalink)  
Old February 22nd, 2005, 03:09 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Is this on one line:

sPageName = sPageName.substr(sPageName.lastIndexOf('/')
 + 1).toLowercase();

I am not sure if this P2P post messes up the formatting, or that the code is actually like that in your page. (In the book we had to wrap the text to fit it on the page :))

It should read like this:

sPageName = sPageName.substr(sPageName.lastIndexOf('/') + 1).toLowercase();

Make sure you change this in the original ASP page, not the HTML source you opened....

If that doesn't help, can you post the entire code for the page? Then I can see if there is menu item called home for example.

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
  #14 (permalink)  
Old February 22nd, 2005, 10:37 PM
Authorized User
 
Join Date: Jan 2005
Location: , , .
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Again!

 I tried it as one line and as two, and neither worked...

Here is the code for the entire page, from the Browser:

<html>
<head>

<title>GlobalSoccerEvents.com - Your Source for Soccer Events Around the Globe</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style type="text/css">
<!--
td {
    font-family: Arial, Helvetica, sans-serif;
    color: #000000;
}
a {
    font-family: Arial, Helvetica, sans-serif;
    color: #669933;
}
-->
</style>
</head>

<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><img src="Images/logo.gif">&nbsp;</td><td><table border="0" align="right" cellpadding="0" cellspacing="0">

  <tr>
    <td><a href="home.asp" id="home">Home</a></td><td>&nbsp;&nbsp;&nbsp;</td><td><a href="events.asp" id="events">Events</a></td><td>&nbsp;&nbsp;&nbsp;</td><td><a href="mySite.asp" id="mysite">MySite</a></td></tr>
</table></td></tr>
</table><br>
<script language="JavaScript" type="text/javascript">
var sPageName = '/thesoccersite/home.asp';
sPageName = sPageName.substr(sPageName.lastIndexOf('/') + 1).toLowercase();
sPageName = sPageName.substr(0, sPageName.lastIndexOf('.'));
if (document.getElementById(sPageName))
{
document.getElementById(sPageName).style.fontweigh t = 'Bold';
document.getElementById(sPageName).style.fontsize = '14pt';
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><h2>Welcome to Global Soccer Events.com</h2></td>
    </tr>

  <tr>
    <td>Your Source for Soccer Events Around the Globe!</td>
    </tr>
  <tr>
    <td align="center"><br> <br> <br> <br> <br>
      Having Difficulties? Contact
      the Webmaster.</td>

  </tr>
</table>
</body>
</html>


  #15 (permalink)  
Old February 23rd, 2005, 06:16 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi again,

Finally had the time to quickly look at your code. I noticed three errors:

sPageName = sPageName.substr(sPageName.lastIndexOf('/') + 1).toLowercase();

should be

sPageName = sPageName.substr(sPageName.lastIndexOf('/') + 1).toLowerCase();

with an upper case C.

The other two errors are in the if statement:

document.getElementById(sPageName).style.fontweigh t = 'Bold';
document.getElementById(sPageName).style.fontsize = '14pt';

should be

document.getElementById(sPageName).style.fontWeigh t = 'Bold';
document.getElementById(sPageName).style.fontSize = '14pt';

with a capital W and a capital S in fontWeight and fontSize.

Please realize that JavaScript is *very* case sensitive....

Cheers,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
  #16 (permalink)  
Old February 23rd, 2005, 09:31 PM
Authorized User
 
Join Date: Jan 2005
Location: , , .
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Default

YAY!!!!!! It works!! I thought I looked over everything!!

Thanks a million!

 Who would have thought that capital letters would make such a difference??



:D:D
  #17 (permalink)  
Old February 24th, 2005, 03:07 AM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Great. Glad it's working.

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Javascript Problem monika.vasvani ASP.NET 1.0 and 1.1 Professional 2 December 7th, 2006 02:39 AM
Javascript Problem dparsons ASP.NET 1.0 and 1.1 Basics 2 March 22nd, 2006 01:41 PM
Help: problem with javascript hilechen Javascript 1 December 6th, 2005 06:58 AM
Beginning D.W.2004 SoccerSite terry s Dreamweaver (all versions) 7 October 26th, 2004 03:25 PM
Javascript problem highcliffevillage Javascript How-To 0 July 8th, 2004 07:13 AM



All times are GMT -4. The time now is 01:50 PM.


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