#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Miami, FL
    Posts
    47
    Rep Power
    12

    Question JavaScript in a JSP page...


    I'm trying to make a JSP page with some JavaScript but it's not displaying correctly. I'm guessing the problem is with the <SCRIPT> tags. Anyone know how to remedy this? The code is posted below:

    <script language="JavaScript">
    <!--
    function fwLoadMenus() {
    if (window.fw_menu_0) return;
    window.fw_menu_0 = new Menu("root",100 ,30,"Verdana, Arial, Helvetica, sans-serif",10,"#FFFFFF","#FFFFFF","#E37A01","#1674AD");
    fw_menu_0.addMenuItem("Water&nbsp;<BR>Conservation","location='../ps_pu_wc.jsp'");
    fw_menu_0.addMenuItem("Neighborhood&nbsp;<BR>Relations","location='../ps_pu_nr.jsp'");
    fw_menu_0.addMenuItem("Publications","location='../ps_pr_pu.jsp'");
    fw_menu_0.hideOnMouseOut=true;

    fw_menu_0.writeMenus();
    }

    //-->
    </script>

    <script language="JavaScript1.2">fwLoadMenus();</script>

    <TR>
    <TD colspan="3">
    <TABLE class="capsule" width="606px">
    <TR>
    <TD align="middle">
    <A href="../ps_pu.jsp" onMouseOver="rollDown('pu')" onMouseOut="rollUp('pu')">
    <IMG SRC="../images/pu_up.gif" BORDER="0" NAME="pu">
    </A>
    <A href="../ps_pw.jsp" onMouseOver="rollDown('pw')" onMouseOut="rollUp('pw')">
    <IMG SRC="../images/pw_up.gif" BORDER="0" NAME="pw">
    </A>
    <A href="../ps_pr.jsp" onMouseOver="rollDown('pr')" onMouseOut="rollUp('pr')">
    <IMG SRC="../images/pr_up.gif" BORDER="0" NAME="pr">
    </A>
    <%
    int temp=0;
    if (pageLocation.substring(0,1).compareTo('pu')
    {
    temp=400;

    }
    else
    {
    temp=152;
    }
    %>
    <A href="" <a href="#" onMouseOut="FW_startTimeout(); rollUp('ql')" onMouseOver="window.FW_showMenu(window.fw_menu_0,466,<%=temp%>); rollDown('ql')">
    <IMG SRC="../images/ql_up.gif" BORDER="0" NAME="ql">
    </A>
    </TD>
    </TR>
    </TABLE>
    </TD>
    </TR>
    David C. Pulgar
    www.zenithlight.net

    PETER: Good morning Mr. Sun
    SUN: Good Morning Peter
    PETER: Isn't it a beautiful day Mr. Sun?
    SUN: It's always a beautiful day with two scoops of raisins Peter!
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Miami, FL
    Posts
    47
    Rep Power
    12
    BTW I caught the error in the "if" statement and fixed it but it still doesn't work.
    David C. Pulgar
    www.zenithlight.net

    PETER: Good morning Mr. Sun
    SUN: Good Morning Peter
    PETER: Isn't it a beautiful day Mr. Sun?
    SUN: It's always a beautiful day with two scoops of raisins Peter!
  4. #3
  5. No Profile Picture
    Clueless llama
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Feb 2001
    Location
    Lincoln, NE. USA
    Posts
    2,353
    Rep Power
    117
    That this is a jsp is irrelevant to the problem you are having. You also don't post all your javascript, so it is impossible to load this and troubleshoot it. Considering you have very little java code in there, I would remove and hard code some value and post this to the html/javascript forum with all your code and see if you can't get some answers there.
  6. #4
  7. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Miami, FL
    Posts
    47
    Rep Power
    12
    Nevermind, got it to work...stupid quotes. :P
  8. #5
  9. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Miami, FL
    Posts
    47
    Rep Power
    12
    Thx for the help Nemi, in the end it was just a stupid mistake on my part. I really need to get a code validator this notepad stuff is tedious.
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Round Rock, Texas
    Posts
    8
    Rep Power
    0
    Originally posted by javakills
    Thx for the help Nemi, in the end it was just a stupid mistake on my part. I really need to get a code validator this notepad stuff is tedious.
    My (admittedly limited) experience w/ web development tells me that a smart color coding editor is essential. I've used several on the PC but they all had some annoying limitations. I use HTML-Kit because it's freeware and it mostly works. It color codes ASP, VBScript, Javascript all at once on the page, which too many other color-coding editors do not do. HTML-Kit has a bit of a quirky interface, IMHO, and has trashed a file twice on me, but other folks haven't had problems.

    But my absolute favorite editor is BBEdit. Sorry, it's available on the Macintosh only. I've been using it for some years, and to date no PC editor I've seen matches it. Sometimes I go out of my way to use it on my PC-based projects because I get *very* tired of the foibles of PC editors. BBEdit has built-in FTP capabilites, handles DOS & UNIX line returns, and much more which makes the job easier.

IMN logo majestic logo threadwatch logo seochat tools logo