which is better xhtml or html, javascript or ajax

lordsofvine

New Member
Messages
41
Reaction score
0
Points
0
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.....
 

saviornt

New Member
Messages
4
Reaction score
0
Points
0
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
 

xPlozion

New Member
Messages
868
Reaction score
1
Points
0
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
 

marshian

New Member
Messages
526
Reaction score
9
Points
0
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:
<?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:

xPlozion

New Member
Messages
868
Reaction score
1
Points
0
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.

http://www.w3.org/TR/xhtml1/#strict said:
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.
 
Top