 |
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 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
|
|
|
|

February 21st, 2005, 11:10 PM
|
|
Authorized User
|
|
Join Date: Jan 2005
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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!
|
|

February 21st, 2005, 11:14 PM
|
|
Authorized User
|
|
Join Date: Jan 2005
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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!
|
|

February 22nd, 2005, 03:09 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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.
|
|

February 22nd, 2005, 10:37 PM
|
|
Authorized User
|
|
Join Date: Jan 2005
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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"> </td><td><table border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td><a href="home.asp" id="home">Home</a></td><td> </td><td><a href="events.asp" id="events">Events</a></td><td> </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>
|
|

February 23rd, 2005, 06:16 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
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.
|
|

February 23rd, 2005, 09:31 PM
|
|
Authorized User
|
|
Join Date: Jan 2005
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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
|
|

February 24th, 2005, 03:07 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Great. Glad it's working.
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|
|
 |