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.....
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.....
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
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:For more information, check out W3SchoolsCode:<!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
for my XHTML transitional (ASCI encoding)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">
Of course, don't save this as a .php file, since <? is the shorthand for <?php ...
solves thisPHP 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">
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.
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.
Originally Posted by http://www.w3.org/TR/xhtml1/#strict