dynamic display

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • raj

    dynamic display

    hi
    My html is:


    <Table style="year-button-archive" width="60%" >
    <tr>
    <td class="gold" >
    <a title="year">By Year:</a>
    <td class="gold">
    <a id = "2008" title="2008" href="../
    announcementLis t.do?year=2008" >
    2008
    </a>&nbsp; | &nbsp;</td>
    <td class="gold">
    <a id = "2007" title="2007" href="../
    announcementLis t.do?year=2007" >2007 </a>&nbsp; | &nbsp;
    </td>
    <td class="gold">
    <a id = "2006" title="2006" href="../
    announcementLis t.do?year=2006" >2006</a>&nbsp; | &nbsp;
    </td>
    <td class="gold">
    <a id = "2005"title="20 05" href="../
    announcementLis t.do?year=2005" >2005 </a>&nbsp; | &nbsp;
    </td >
    <td class="gold">
    <a id = "all" title="All" href="../
    announcementLis t.do?year=all"> All </a>
    </td>
    </tr>
    </Table>

    my css



    1. .gold {
    2. color: #877514;
    3. }
    4. .gold A:link {COLOR: #877514; TEXT-DECORATION: none }
    5. .gold A:visited {COLOR: #877514; TEXT-DECORATION: none }
    6. .gold A:hover {COLOR:red; TEXT-DECORATION: underline; }
    7. .gold A:active {COLOR: #877514; TEXT-DECORATION: none }
    8.



    on clicking the year i need to change the colour to red and should be
    in red till i click another year.so i had written js

    function showYear(){
    alert(<%= request.getPara meter("year") %>);
    var sYear = <%= request.getPara meter("year") %>;
    alert("sYear" +sYear);
    if(sYear != null){
    alert(sYear);
    document.getEle mentById(sYear) .style.color = "red";
    }
    }


    it works fine for the years 2008,7,6,5 ..in my first alert stmt
    i get 2008,7,6,5 correctly from the request but when i click on all i
    am not getting all from the request its taking full URL.
    like http://localhost:8080/sgxt/announcementList.do?year=all
    it should take
    all alone.
    what may be the cause of this behavior when its working for other
    years

    Thanks in advance
    Raj

  • David Mark

    #2
    Re: dynamic display

    On Oct 9, 11:38 pm, raj <2rajes...@gmai l.comwrote:
    hi
    My html is:
    Awful. Sorry, it has to be said.
    >
    <Table style="year-button-archive" width="60%" >
                    <tr>
                        <td class="gold" >
                            <a title="year">By Year:</a>
                        <td class="gold">
                            <a id = "2008" title="2008" href="../
    announcementLis t.do?year=2008" >
                            2008
                            </a>&nbsp; | &nbsp;</td>
                        <td class="gold">
                            <a id = "2007" title="2007" href="../
    announcementLis t.do?year=2007" >2007 </a>&nbsp; | &nbsp;
                        </td>
                        <td class="gold">
                            <a id = "2006" title="2006" href="../
    announcementLis t.do?year=2006" >2006</a>&nbsp; | &nbsp;
                        </td>
                        <td class="gold">
                            <a id = "2005"title="20 05"  href="../
    announcementLis t.do?year=2005" >2005 </a>&nbsp; | &nbsp;
                        </td >
                        <td class="gold">
                            <a id = "all" title="All" href="../
    announcementLis t.do?year=all"> All </a>
                        </td>
                        </tr>
                </Table>
    >
    my css
    >
       1. .gold {
       2.     color: #877514;
       3. }
       4.     .gold A:link {COLOR: #877514;    TEXT-DECORATION: none }
       5.     .gold A:visited {COLOR: #877514; TEXT-DECORATION: none }
       6.     .gold A:hover {COLOR:red;    TEXT-DECORATION: underline; }
       7.     .gold A:active {COLOR: #877514;    TEXT-DECORATION:none }
       8.
    What if you want to go with a silver theme in the future? And how
    will a color-blind person see your links? Are they to hover over
    every word on the page looking for underlines?
    >
    on clicking the year i need to change the colour to red and should be
    in red till i click another year.so i had written js
    Okay. It's your page.
    >
    function showYear(){
            alert(<%= request.getPara meter("year") %>);
    Don't post server side code here.
            var sYear = <%= request.getPara meter("year") %>;
            alert("sYear" +sYear);
            if(sYear != null){
            alert(sYear);
            document.getEle mentById(sYear) .style.color = "red";
            }
    >
    }
    Too much, too soon. Learn HTML and CSS first.
    >
    it works fine for the years 2008,7,6,5 ..in my first alert stmt
    i get 2008,7,6,5 correctly from the request but when i click on all i
    am not getting all from the request its taking full URL.
    like  http://localhost:8080/sgxt/announcementList.do?year=all
    it should take
    all alone.
    what may be the cause of this behavior when its working for other
    years
    Rule #1. Start with valid markup. Then when something goes wrong,
    you have one less variable to consider. And what a variable it is.
    There are no standard specifications for HTML error correction.

    Rule #2. Use a proper doctype so that browsers don't downshift into
    quirks mode. Quirks mode is there to deal with invalid and/or
    deprecated markup. If you followed the first rule, then you don't
    have any.

    Yes, it seems 99% of today's Websites break one or the other of these
    rules. That's why scripts fail constantly on the Internet (and
    seemingly never get fixed.) Follow the rules and you are way ahead of
    the game.

    So now debug the script. If you can't, post it without the server
    side includes.

    Comment

    Working...