+ Reply to Thread
Results 1 to 5 of 5

Thread: CSS or Javascript?

  1. #1
    kkenny's Avatar
    kkenny is offline Lord Of The Keys kkenny is an unknown quantity at this point
    Join Date
    Feb 2008
    Location
    I REP THE BAY. (Bay Area, CA, USA)
    Posts
    1,950

    CSS or Javascript?

    I'm planning on improving my friend's base layout, which has some Dynamic HTML and XHTML already, but I want to improve it by either using CSS or Javascript. I'm not sure which one to use, but here are a few questions I have for each language.

    I know each language pretty decent, so learning more of it wouldn't be much of a problem.

    What is supported in more browsers CSS/JS?
    What has a tendency to be easier to code (Advanced CSS versus Advanced JS)?
    Which is loaded faster (for example, friendly to the dial up users)?
    and any other comments.

    I really need to know which one I should use. They both seem like excellent languages. But having both could become a hassle so I'll have to choose one.
    kkenny - retired.
    -Became a Moderator/Staff Member on 4/23/08
    -Became Senior Mod on 8/28/08
    -Became Account Manager on 10/18/08
    -Left Staff and X10 in 2009.


  2. #2
    konekt's Avatar
    konekt is offline x10 Sophmore konekt is an unknown quantity at this point
    Join Date
    Mar 2008
    Posts
    100

    Re: CSS or Javascript?

    CSS and Javascript are highly dissimilar languages. One is, as the name suggests, a scripting language. You can automate interactions and functions, however, the front end depends on implementation of the DOM and elements of HTML/CSS.

    Any styling you would do would, ultimately, go through either HTML or CSS properties (you can also call in Mozilla elements, but it is not common practice). Thus, for function you would use javascript and link it with CSS for display.

    For your questions:
    What is supported in more browsers CSS/JS?

    Due to their dissimilar nature (as aforesaid) you can not compare them. It can be said, however, that both have a high capability with most browsers and SHOULD be supported by all.

    What has a tendency to be easier to code (Advanced CSS versus Advanced JS)?


    In my opinion, CSS is very easy because it is not really a coding language. It is, once again as the name suggests, a simple markup style that does not depend on logic or variable maintenance to a high degree.

    Javascript is based on prototypical object-oriented inheritance so it shares similarities with the high-end languages such as C++.

    Which is loaded faster (for example, friendly to the dial up users)?

    Again, unnoticeable and incomparable.


    From your questions I gather you have very little knowledge of either. In my opinion the difference is much the same as the difference between the layout of a mathematics textbook and the material in it. The type-face and formating- the CSS- all mandate the look of the textbook but do not reflect the technical nature of the subject- the javascript. They serve different purposes.

    As an afterthought: for simple websites that only present information, CSS is the way to go. If you want user-interaction, Javascript will most likely rear its head. Ultimately, CSS is much easier to implement and can not, through conventional means, be disabled on the user-side like javascript can.
    Last edited by konekt; 06-21-2008 at 02:57 AM.

  3. #3
    marshian's Avatar
    marshian is offline x10 Elder marshian is an unknown quantity at this point
    Join Date
    Jan 2008
    Location
    Belgium
    Posts
    526

    Re: CSS or Javascript?

    What is supported in more browsers CSS/JS?
    They're both supported by the most browsers, a lot of them not keeping to the standards, but they still got something... But an advantage of CSS over JS is that it's possible to turn JS off, which a lot of people do to protect their pc. This would cause your layout to break.
    Of course, you could also turn off css, but as you'll need css even if you're using JS, practicly every site's layout would break. Nobody can blame you for that, and the user will probally quickly turn css back on. (Compared with JS: most sites remain intact, the user won't turn it back on if he previously turned it off for security reasons.)
    Real programmers don't document their code - if it was hard to write, it should be hard to understand.

  4. #4
    VPmase's Avatar
    VPmase is offline x10 Elder VPmase is an unknown quantity at this point
    Join Date
    Nov 2007
    Location
    Dixon, IL, USA
    Posts
    914

    Re: CSS or Javascript?

    I would recommend using CSS since you cannot disable it in most, if not all, browsers.

  5. #5
    kkenny's Avatar
    kkenny is offline Lord Of The Keys kkenny is an unknown quantity at this point
    Join Date
    Feb 2008
    Location
    I REP THE BAY. (Bay Area, CA, USA)
    Posts
    1,950

    Re: CSS or Javascript?

    Okay, I guess CSS it is then. Time to replace the Intermediate JS in my head and replace it with Advanced CSS. Thanks guys.
    kkenny - retired.
    -Became a Moderator/Staff Member on 4/23/08
    -Became Senior Mod on 8/28/08
    -Became Account Manager on 10/18/08
    -Left Staff and X10 in 2009.


+ Reply to Thread

Similar Threads

  1. drop down menus with JavaScript disabled?
    By sifaka in forum Free Hosting
    Replies: 1
    Last Post: 05-15-2008, 10:46 AM
  2. javascript and external javascript files problem
    By delon in forum Programming Help
    Replies: 6
    Last Post: 04-27-2008, 12:41 AM
  3. A question about javascript files
    By rlodge in forum Programming Help
    Replies: 6
    Last Post: 12-19-2007, 11:26 AM
  4. XML and Javascript
    By cuteboytm in forum Graphics & Webdesign
    Replies: 1
    Last Post: 09-21-2007, 10:00 AM
  5. Some nice-simple JavaScript effects !!
    By careerbridge in forum Scripts & 3rd Party Apps
    Replies: 1
    Last Post: 07-13-2006, 08:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers