+ Reply to Thread
Results 1 to 5 of 5

Thread: which is better xhtml or html, javascript or ajax

  1. #1
    lordsofvine is offline x10Hosting Member lordsofvine is an unknown quantity at this point
    Join Date
    May 2008
    Posts
    41

    Question which is better xhtml or html, javascript or ajax

    i need to know which is better xhtml or html, javascript or ajax, do you have any idea, because i'm really confuse right now thanks.....

  2. #2
    saviornt is offline x10Hosting Member saviornt is an unknown quantity at this point
    Join Date
    Aug 2008
    Posts
    4

    Re: which is better xhtml or html, javascript or ajax

    xhtml is better than normal html (only difference is that everything has to have a closing tag afaik)..

    and AJAX is javascript (combined with XML and css).

    AJAX = Asynchronous Javascript And Xml :p

  3. #3
    xPlozion's Avatar
    xPlozion is offline x10 Elder xPlozion is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Delaware, USA
    Posts
    872

    Re: which is better xhtml or html, javascript or ajax

    IMO, XHTML is much easier to maintain and has cleaner code than HTML. All elements <p></p> must be lowercase, and you must close EVERY tag you open. <img src='http://www.blah.com/img.jpg' alt='Blah' />

    As far as converting from HTML to XHTML, it's not that hard. Also, try to set your standards on XHTML Strict.

    Here's how the top of your page would look if you were using XHTML Strict:
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    For more information, check out W3Schools

  4. #4
    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: which is better xhtml or html, javascript or ajax

    Quote Originally Posted by xPlozion View Post
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    I agree with XHTML being easier to maintain, but the doctype isn't right I think... I beleive W3C would complain about not finding an encoding...
    I always use
    Code:
    <?xml version="1.0" encoding="ISO-8859-15" ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    for my XHTML transitional (ASCI encoding)
    Of course, don't save this as a .php file, since <? is the shorthand for <?php ...
    PHP Code:
    <?php
    echo "<"."?xml version=\"1.0\" encoding=\"utf-8\"?".">\n";
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    solves this
    Last edited by marshian; 08-30-2008 at 02:09 PM.
    Real programmers don't document their code - if it was hard to write, it should be hard to understand.

  5. #5
    xPlozion's Avatar
    xPlozion is offline x10 Elder xPlozion is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Delaware, USA
    Posts
    872

    Re: which is better xhtml or html, javascript or ajax

    You are right. It's highly recommended, but it's not required. Also, W3C does not complain about it not being there, but the source code of w3's page contains that on top.

    Quote Originally Posted by http://www.w3.org/TR/xhtml1/#strict
    An XML declaration is not required in all XML documents; however XHTML document authors are strongly encouraged to use XML declarations in all their documents. Such a declaration is required when the character encoding of the document is other than the default UTF-8 or UTF-16 and no encoding was determined by a higher-level protocol.

+ Reply to Thread

Similar Threads

  1. Help with HTML code cleaning (javascript)
    By oracle in forum Programming Help
    Replies: 2
    Last Post: 08-28-2008, 01:59 PM
  2. Replies: 0
    Last Post: 08-17-2008, 01:46 AM
  3. Do you use strict or transitional HTML or XHTML?
    By sclewin in forum Crossfire
    Replies: 10
    Last Post: 08-11-2008, 04:22 AM
  4. HTML or XHTML?
    By sclewin in forum Crossfire
    Replies: 26
    Last Post: 08-04-2008, 05:38 AM
  5. [IPB] Contiguous Board Index
    By phenetic in forum Tutorials
    Replies: 5
    Last Post: 09-18-2005, 10:31 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