SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 39 of 39
  1. #26
    SitePoint Enthusiast
    Join Date
    Feb 2002
    Location
    Birmingham, UK
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Flawless, I really don't see what you're gettign at. YET AGAIN you're trying to confuse the issue :P No one is talking about remote scripting, or pulling info from a database TO DO alternating row colours.

    I understand you haven't had much experience with databases and web pages, so let me sum it up quickly for you with reference to the alternating colours.

    1) Start execution of serverside code
    2) Connect to a database and pull out the required records
    3) Start production of clientside code based on contents of recordset (INCLUDING ALTERNATING ROW COLOURS IF APPROPRIATE)
    4) Stop being a goit! :P

  2. #27
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


    Read my last damn point.

    There's NO need to do the connection clientside!

    WITH or WITHOUT a database!

    I think he's asking for a solution that works clientside independant of whether or not a connection
    to a database is being made.
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  3. #28
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My point is - let's not confuse anyone about where
    a database connection be made. Server side!

    Now this thread is about alternating colours - NOT about database connections - HENCE the "with or without".

    We're talking clientside - otherwise it would be in an ASP forum for serverside javascript!

    And NO ... my god damn experience of Programming or databases is NOT a fecking issue here!
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  4. #29
    SitePoint Enthusiast
    Join Date
    Feb 2002
    Location
    Birmingham, UK
    Posts
    86
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Flawless_koder


    Read my last damn point.

    There's NO need to do the connection clientside!

    WITH or WITHOUT a database!

    I think he's asking for a solution that works clientside independant of whether or not a connection
    to a database is being made.
    Agreed, but he also specified it to be with OR without database connection - implying he probably had serverside scripting abilities, hence the suggestions for serverside code to do the alternating colours (as it's a better solution).

    There's no need to be honey, we all still you. No one ever said your solution was wrong... they just suggested better alternatives under certain circumstances. Your JS solution is perfect if there's no ability for a serverside one.

  5. #30
    That's Right. notepad_coder's Avatar
    Join Date
    Apr 2002
    Location
    Colorado
    Posts
    835
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What if you put the information in an array then you can still use clientside and have no need for a database right?

    like
    PHP Code:
    var = new array();
    b[0] = "1"
    b[2] = "2"

    var 0
    var 0
    while (show b[x]) {
      if (
    "0"bgColor "#ffffff"
      
    else bgColor "#eeeeee"
      
    document.write("<td bgcolor=" bgColor ">" show "</td>");
      
    x++
      
    y++

    What about that?
    - the lid is off the maple syrup again!

  6. #31
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No.

    There's no point it creating JS variables for the contents of the table when you can just write the table out normally. Then alter the table's attributes clientside.

    If you're going to use that style, then you should do it with a server side language.


    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  7. #32
    That's Right. notepad_coder's Avatar
    Join Date
    Apr 2002
    Location
    Colorado
    Posts
    835
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But it looks cooler then just HTML

    but your right
    - the lid is off the maple syrup again!

  8. #33
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The same way as Kermit looks cooler than a sock puppet, but sometimes we just have to make do.

    *runs off to play with his sock puppets*

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  9. #34
    Prolific Blogger silver trophy Technosailor's Avatar
    Join Date
    Jun 2001
    Location
    Before These Crowded Streets
    Posts
    9,446
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Flawless_koder
    what the HOLY SH*T @ the length of that answer?!?!
    language...language. Watch the language.

    Sketch
    Aaron Brazell
    Technosailor



  10. #35
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ok ok... i'm sorry.

    * whispers "dad" *
    he he

    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  11. #36
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is all semantics. Javascript can be unreliable and/or people may have it turned off.

    Just use STYLESHEETS!

    Assign a class to each TR then you can change attributes of that TR to your hearts content.

    <style type="text/css">
    <!--
    .odd {background-color: #000000; color: #ffffff;}
    .even {background-color: #999999; color: #ffffff;}
    -->
    </style>

    <tr class="odd">
    <tr class="even">

    That will give the odd TABLE rows a black background with white text and the even rows a dark grey background with white text.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  12. #37
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm sorry, but you are REALLY missing the point here.

    We established that about twenty posts ago.

    We also established how to do it clientside, after
    the table is written by html, OR by writing the table by html.

    We then ALSO established how to do it server side.

    You'll notice one of my first posts showed how to dynamically alternate the class once the table had been
    written.

    Your post is dramatically late i'm afraid, and doesn't actually handle the issue of how to ALTERNATE the class, which is what the entire thread is about ( or at least it was until Mullie and i mis understood each other's ideas of server side and client side database connections ).

    Flawless
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---

  13. #38
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lmfao nice 1 Flawless.

    @ Andrew - who's bound to comment.
    yep heres my comment

    how the hell did you get this from that

    i have been searching for a bit of javascript to alternate table row colors (from a database or not). So far i have had no luck, does anybody know if this can easily be done with the DOM
    a database is completely unneccessary, you could just use xml to carry the data, but any how just use javascript, if you need to change each section just change the classes in a css file and just use that code that flawless put.

    Ps, using a database for this is rediculous. Hehe flawlass i guess you know me by now

  14. #39
    Perl/Mason Guru Flawless_koder's Avatar
    Join Date
    Feb 2002
    Location
    Gatwick, UK
    Posts
    1,206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sure do!

    You think THIS is a headache... my Mason is killing me :
    Code:
    % elsif ($format eq "HTML" && $Opts){
    
    Additional Options:
    ========== ========
    
    %       foreach my $key (keys(%Opts)){
    %               next if (!$key);
    %               if ($Opts{$key}->{sel}){
       <% ($Opts{$key})->{'desc'} %>:     <%(($Opts{$key})->{'timesens'} eq "P")?"":$Webres::SETUP::currency%><%($Opts{$key})->{'rate'} %><%(($Opts{$key})->{'timesens'} eq "P")?"%":""%><%(($Opts{$key})->{'timesens'} eq "F")?" (x $Opts{$key}->{qty})":""%>
    %                       }
    %               }
    %       }
    And yes.. that middle bit is ALL one damn line.
    ---=| If you're going to buy a pet - get a Shetland Giraffe |=---


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •