Wrox Programmer Forums
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Dreamweaver (all versions) 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 May 30th, 2005, 11:32 AM
Registered User
 
Join Date: May 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Soccer site Template

Hi,
  I have a problem with the Javascript that is used in the
home page of the soccer site to turn home bold green.
It does not work! and I do not get any error messages.Also the link to events works but the same thing as the home page.Thaks for any help you may have.
Code for the events.asp page

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

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

<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" width="257" height="58"></td>
    <td>
      <table border="0" cellspacing="0" cellpadding="0">
        <tr align="right">
          <td><div align="right"><a href="home.asp" id="home">Home</a></div></td>
          <td>&nbsp;&nbsp;&nbsp;
              <div align="right"></div></td>
          <td><div align="right"><a href="events.asp" id="events">Events</a></div></td>
          <td>&nbsp;&nbsp;&nbsp;
              <div align="right"></div></td>
          <td><div align="right"><a href="mySite.asp" id="mysite">My Site</a></div></td>
        </tr>
      </table></td>
      </tr>
      </table>
      <br>
      <script language="JavaScript" type="text/javascript">
        var sPageName = '<%Request.ServerVariables("SCRIPT_NAME")%>';
        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>Current Events </h2></td>
  </tr>
  <tr>
    <td>-Page Content Here- </td>
  </tr>
  <tr>
    <td align="center"><br> <br> <br> <br> <br>
      -Footer Here-</td>
  </tr>
</table>
</body>
</html>


 
Old May 30th, 2005, 01:29 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Looks like you missed an = character:

<%Request.ServerVariables("SCRIPT_NAME")%>

should be

<%=Request.ServerVariables("SCRIPT_NAME")%>


And is the original source of the ASP page, or the resulting Html of it in the browser? If the latter is true, your page may not be correctly parsed by the ASP engine...

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Two Tribes by Frankie Goes To Hollywood (Track 1 from the album: Welcome to the Pleasuredome) What's This?
 
Old May 30th, 2005, 04:18 PM
Registered User
 
Join Date: May 2005
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks very much!, that has sorted the problem.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Beginning DW.MX 2004 Global Soccer terry s Dreamweaver (all versions) 6 October 13th, 2004 02:40 PM
Beginning Dreamweaver Mx 2004 (Global Soccer) terry s Dreamweaver (all versions) 5 September 26th, 2004 06:08 AM





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