Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: JS Output?

  1. #1
    Regular Coder
    Join Date
    Apr 2006
    Posts
    231
    Thanks
    9
    Thanked 1 Time in 1 Post

    JS Output?

    What would be the valid output for javascript? (like php has echo, c++ has cout)I tried looking on google but couldn't find anything.

    I'm trying to make a simple, very simple script in javascript. I was going to use php but it didn't really work out. CuteNews doesn't accept php in their templates?

    it looks something like this in php
    Code:
    <?php 
    if($countnews<10){
    echo("<tr><td class=\"side\">{date}: {short-story}</td></tr>");}
    else{
    echo("<tr><td class=\"sidebottom\">{date}: {short-story}</td></tr>");}
    $countnews=$countnews+1;
    ?>
    $countnews is declared at the head of the document as 0. When the news displayed gets to 10, it will change the class of the cell to sidebottom.

    Like I said, it doesn't work in php because cutenews doesn't allow it for some reason. Can anyone take 30 seconds and convert that to javascript?

  • #2
    Senior Coder
    Join Date
    Feb 2006
    Location
    USA
    Posts
    1,013
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Learn CSS. | SSI | PHP includes | X/HTML Validator | CSS validator | Dynamic Site Solutions
    Java != JavaScript && JScript != JavaScript
    Design/program for Firefox (and/or Opera), apply fixes for IE, not the other way around.


  •  

    Posting Permissions

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