<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Andrei DANEASA &#187; HTML</title>
	<atom:link href="http://www.webxpert.ro/andrei/category/programming/html/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.webxpert.ro/andrei</link>
	<description>Programming, database, security, Oracle, .NET, C#, PHP, Travel</description>
	<lastBuildDate>Tue, 18 Oct 2011 15:42:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Google.com has interstitials ?</title>
		<link>http://www.webxpert.ro/andrei/2009/01/31/googlecom-has-interstitials/</link>
		<comments>http://www.webxpert.ro/andrei/2009/01/31/googlecom-has-interstitials/#comments</comments>
		<pubDate>Sat, 31 Jan 2009 15:41:38 +0000</pubDate>
		<dc:creator>andreiash</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Poor services]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[crash]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[interstitials]]></category>

		<guid isPermaLink="false">http://www.webxpert.ro/andrei/?p=316</guid>
		<description><![CDATA[Today afternoon on any seach on google.com the user was unable to click any of the results since google said it has interstitials. I mean strange, very strange&#8230;. all of them? For those of you that don&#8217;t know what an interstitial is, it&#8217;s an intermediate page shown before the desired page, usually used to advertise [...]]]></description>
			<content:encoded><![CDATA[<p>Today afternoon on any seach on google.com the user was unable to click any of the results since google said it has <strong>interstitials</strong>. I mean strange, very strange&#8230;. all of them? </p>
<p>For those of you that don&#8217;t know what an interstitial is, it&#8217;s an intermediate page shown before the desired page, usually used to advertise something.</p>
<p>Here is the proof that it was either a hack either a very poor programming:<br />
- A search for word &#8220;<strong>google</strong>&#8220;:<br />
<a href="http://www.webxpert.ro/andrei/wp-content/uploads/2009/01/badgoogle.jpg"><img src="http://www.webxpert.ro/andrei/wp-content/uploads/2009/01/badgoogle-300x204.jpg" alt="badgoogle" title="badgoogle" width="300" height="204" class="aligncenter size-medium wp-image-317" /></a></p>
<p>- If i am clicking the link for Google.com, I&#8217;ve got: &#8220;<em><strong>Warning &#8211; visiting this site may harm your computer!</strong></em>&#8220;:<br />
<a href="http://www.webxpert.ro/andrei/wp-content/uploads/2009/01/badgoogle2.jpg"><img src="http://www.webxpert.ro/andrei/wp-content/uploads/2009/01/badgoogle2-300x231.jpg" alt="badgoogle2" title="badgoogle2" width="300" height="231" class="aligncenter size-medium wp-image-318" /></a></p>
<p>Now after more than half an hour Google is working well again&#8230; hopefully this will not happen again in the future&#8230;</p>
<p>Andrei</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webxpert.ro/andrei/2009/01/31/googlecom-has-interstitials/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Internet archive &#8211; website as it was sometime ago</title>
		<link>http://www.webxpert.ro/andrei/2008/06/02/internet-archive-website-as-it-was-sometime-ago/</link>
		<comments>http://www.webxpert.ro/andrei/2008/06/02/internet-archive-website-as-it-was-sometime-ago/#comments</comments>
		<pubDate>Mon, 02 Jun 2008 20:48:02 +0000</pubDate>
		<dc:creator>andreiash</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[archive]]></category>
		<category><![CDATA[internet]]></category>

		<guid isPermaLink="false">http://www.webxpert.ro/andrei/?p=80</guid>
		<description><![CDATA[Did you ever want to check a website as it was 1 year ago for example? I do want, because lots of websites that I initially developed were redesigned during the years and it was nice to find my work in the archive. How it&#8217;s working? It&#8217;s a search engine that takes a snapshot of [...]]]></description>
			<content:encoded><![CDATA[<p>Did you ever want to check a website as it was 1 year ago for example? I do want, because lots of websites that I initially developed were redesigned during the years and it was nice to find my work in the archive.<br />
How it&#8217;s working? It&#8217;s a search engine that takes a snapshot of every website on a regular basis, normally every month.<br />
Where? At: <a href="http://web.archive.org">http://web.archive.org</a></p>
<p>Lots of people are asking me about MPMCostumes.com. They decided to remake the website with their initial partners, even that with my platform they sold more than 20K USD in a few months. Unfortunately on http://web.archive.org the images and flash animations do not appear, but you still can check it as it was 2 years ago.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webxpert.ro/andrei/2008/06/02/internet-archive-website-as-it-was-sometime-ago/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web 2.0 developer tools</title>
		<link>http://www.webxpert.ro/andrei/2008/04/30/web-20-developer-tools/</link>
		<comments>http://www.webxpert.ro/andrei/2008/04/30/web-20-developer-tools/#comments</comments>
		<pubDate>Wed, 30 Apr 2008 12:12:15 +0000</pubDate>
		<dc:creator>andreiash</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.webxpert.ro/andrei/?p=73</guid>
		<description><![CDATA[Web 2.0 is everywhere, lot of people pretend that they are developing web 2.0 applications, but not all of them succeed. I will not make a review here, but just want to unveil some tools that will help building web 2.0 web sites. 1. The fundamental of web 2.0 is Ajax, which is no more [...]]]></description>
			<content:encoded><![CDATA[<p>Web 2.0 is everywhere, lot of people pretend that they are developing web 2.0 applications, but not all of them succeed. I will not make a review here, but just want to unveil some tools that will help building web 2.0 web sites.</p>
<p><strong>1. </strong>The fundamental of web 2.0 is Ajax, which is no more than reloading just parts of the page via JavaScript without reloading the whole page. In order to use Ajax on-the-fly you need to use <a href="http://www.prototypejs.org/">Prototype JavaScript Framework</a>. Prototype also <span id="more-73"></span>extends DOM, which means you are not longer required to fully qualify an object, but just use a shorter name prefixed by $.</p>
<p><strong>2. </strong>To increase the power of Prototype you should use <a href="http://script.aculo.us/">Script.aculo.us</a> , which comes with Prototype built-in. It&#8217;s providing animation framework, drag&#8217;n'drop support, Ajax controls, unit testing. Be honest, didn&#8217;t you want to enrich your normal textbox with auto-complete support provided by the database? And don&#8217;t worry if there will be too many results, because Scritp.aculo.us is highly customizable in limiting the results, setting the minimum characters for auto-complete and so on.  </p>
<p><strong>3. </strong>All the time I wanted some grid controls to provide sorting, in-place editing with Ajax support, powerful tree controls and paging controls. All of them are provided by <a href="http://extjs.com/">ExtJs</a> and many more. If you want to make your web application to look more like a desktop app, without increasing too much network traffic then ExtJs is the solution for this.</p>
<p>4. Do you have a small photo gallery on your website and don&#8217;t want to create a gallery script or integrating a too advanced gallery application on your website? You should use <a href="http://www.huddletogether.com/projects/lightbox/">Lighbox JS</a> , a very small script that will open your images in a very nice way. Implementation is very quick, there is no drawback in using it, it&#8217;s working on all browsers (or if it&#8217;s not working, it will just open the image, without background and open effect).</p>
<p>Good luck on 2.0 !</p>
]]></content:encoded>
			<wfw:commentRss>http://www.webxpert.ro/andrei/2008/04/30/web-20-developer-tools/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to send HTML emails via PHP</title>
		<link>http://www.webxpert.ro/andrei/2006/07/16/how-to-send-html-emails-via-php/</link>
		<comments>http://www.webxpert.ro/andrei/2006/07/16/how-to-send-html-emails-via-php/#comments</comments>
		<pubDate>Sun, 16 Jul 2006 19:47:25 +0000</pubDate>
		<dc:creator>andreiash</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.webxpert.ro/andrei/2006/07/16/how-to-send-html-emails-via-php/</guid>
		<description><![CDATA[How to send HTML emails via PHP]]></description>
			<content:encoded><![CDATA[<p>HTML emails&#8230;.. hmm, not such a good idea.<br />
I am not such a big fan of HTML emails, because I am assaulted by tens of such emails daily, most of them spam ones. And using Microsoft Outlook as email client, it ask me to download (or not) pictures from the server. This could be a bad idea sometimes, because harmful code could be be hidden in image files today (especially GIF files).</p>
<p>I was hired to make a newsletter module for one website and first I started to search how to make this.<br />
The steps are below.</p>
<p><strong>1.</strong> Create the HTML page for newsletter.<br />
<strong>2.</strong> Take care to have the CSS and JS embedded in the HTML file and not outside the file.<br />
<strong>3.</strong> Replace the relative location of image files with absolute location. E.g:<br />
if you have:<br />
[code lang="xml"]<br />
<img src="comingsoon.jpg" alt="Coming Soon"<br />
name="com_soon" width="100" height="35" border="0" id="com_soon" /><br />
[/code]<br />
you must replace with:<br />
[code lang="xml"]<br />
<img src="http://www.webxpert.ro/newsletter/comingsoon.jpg"<br />
alt="Coming Soon" name="com_soon" width="100" height="35"<br />
border="0" id="com_soon" /><br />
[/code]<br />
<span id="more-27"></span><br />
<strong>4.1.</strong> If you want to send the email by Outlook Express, you need to open a new e-mail window, choose File » New » Mail Message. Once your mail window is open, make sure the format is set to Rich Text (HTML) by choosing Format and making sure there is a highlight next to the Rich Text (HTML) line.<br />
Once your e-mail is set to Rich Text, choose View > Source Edit and you should see three tabs at the bottom of your mail message.<br />
Click the Source tab, and you&#8217;ll see the HTML source for your default e-mail message. Copy and paste all your HTML code into Outlook Express Source view.<br />
After you&#8217;ve pasted your HTML code, you can click the Preview tab to see how it will look in Outlook Express. Now all you have to do is type in your recipient&#8217;s addresses, and click &#8220;Send&#8221;.<br />
<strong>4.2.</strong> Dinamically send via PHP. First of all you must assign all the HTML to a variable. Take care to escape double quotes. Then send via mail() function like the following:<br />
[code lang="php"]<br />
<?<br />
$to = "andrei@webxpert.ro";<br />
$object = "newsletter";<br />
$from = "contact@webxpert.ro";<br />
$message="<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"><br />
<html xmlns=\"http://www.w3.org/1999/xhtml\"><br />
<head><br />
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\" /></p>
<style type=\"text/css\">
<!--<br />
body {<br />
	background-color: #000000;<br />
	margin-top: 0px;<br />
}<br />
.normal_text {<br />
	font-family: Verdana, Arial, Helvetica, sans-serif;<br />
	font-size: 10px;<br />
}<br />
.title_text {<br />
	font-family: Verdana, Arial, Helvetica, sans-serif;<br />
	font-size: 12px;<br />
	color: #FFFFFF;<br />
}<br />
[.........................................]<br />
    </table>
</td>
</tr>
</table>
<p></body><br />
</html><br />
";</p>
<p>echo mail($to, $object, $message, "From: $from\nReply-To: $from\nContent-Type: text/html");<br />
?><br />
[/code]</p>
<p>OK, we saw how we can send a HTML email, now let's see why they are not such a good choice:</p>
<ul>
<li> Slow loading due to downloading of graphics</li>
<li> Takes up more space in your email client</li>
<li>Not all computers support html email</li>
<li>Users may not have the required bandwidth or may have download quotas set by their ISPs.</li>
<li>Hackers can send viruses, trojan horses embedded in html email.</li>
<li>Users may turn off the option to receive html email, or use filters to quarantine it. </li>
<li>It encourages people to express themselves with fancy formatting rather than with carefully chosen words.</li>
<li>If you're off-line, opening an HTML email containing images may (by default) open a connection to the internet.</li>
<li>With HTML e-mails, it's very easy to track who opened the e-mail you sent, when they opened it, and maybe even more. Imagine putting a bit of code like this into an HTML e-mail:<br />
[code lang="xml"]<br />
<img src= "http://www.spam.com/saveinfo.php?sentTo=you@yourhost.com"<br />
width=1 height="1" border="0"><br />
[/code]<br />
When the e-mail is opened, the image is fetched, but the e-mail address is sent along with the request. Now the operator knows that out of the thousands of people he spammed, this particular person opened it. In most cases, this is rude. You can gather information about someone without disclosing the practice. In fact, if you make it a tiny 1x1 image, they may not even have the clue of seeing an image in the e-mail.</li>
</ul>
<p><em><br />
Andrei<br />
<a href="http://www.webxpert.ro">http://www.webxpert.ro</a></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webxpert.ro/andrei/2006/07/16/how-to-send-html-emails-via-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to suppress extra vertical space after HTML forms</title>
		<link>http://www.webxpert.ro/andrei/2006/01/25/how-to-suppress-extra-vertical-space-after-forms/</link>
		<comments>http://www.webxpert.ro/andrei/2006/01/25/how-to-suppress-extra-vertical-space-after-forms/#comments</comments>
		<pubDate>Wed, 25 Jan 2006 09:38:48 +0000</pubDate>
		<dc:creator>andreiash</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.webxpert.ro/andrei/2006/01/25/how-to-suppress-extra-vertical-space-after-forms/</guid>
		<description><![CDATA[Typical formatting of all HTML 4.0 FORM tag has a strange behavior when it contains a table cell inside. A strange vertical space appears after the FORM, even there is no &#60;BR&#62; or something else there.]]></description>
			<content:encoded><![CDATA[<p>Typical formatting of all HTML 4.0 FORM tag has a strange behavior when it contains a table cell inside. A strange vertical space appears after the FORM, even there is no &lt;BR&gt; or something else there.<br />
Here is the a typical behavior:</p>
<table width="300" cellspacing="0" cellpadding="2" border="1" style="text-align: left; background-color: #336699">
<tr>
<td>
<form name="example1" style="margin-bottom: 1.33em">
<table width="100%" cellspacing="0" cellpadding="2" border="1" style="text-align: left; background-color: #ffffff">
<tr>
<td><small><span style="font-family: Tahoma">Email:</span></small></td>
<td>
<input value="just a test" name="text1" /></td>
</tr>
<tr>
<td colspan="2">
<input type="submit" value="Submit" name="Submit" /></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<p>and the code is:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="sc2"><a href="http://december.com/html/4/element/table.html"><span class="kw2">&lt;table</span></a> <span class="kw3">style</span>=<span class="st0">&quot;text-align: left; background-color: #336699; width: 300px;&quot;</span> <span class="kw3">border</span>=<span class="st0">&quot;1&quot;</span> <span class="kw3">cellpadding</span>=<span class="st0">&quot;2&quot;</span> <span class="kw3">cellspacing</span>=<span class="st0">&quot;0&quot;</span><span class="kw2">&gt;</span></span><br />
&nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/tr.html"><span class="kw2">&lt;tr&gt;</span></a></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/td.html"><span class="kw2">&lt;td&gt;</span></a></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/form.html"><span class="kw2">&lt;form</span></a> <span class="kw3">name</span>=<span class="st0">&quot;example1&quot;</span><span class="kw2">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/table.html"><span class="kw2">&lt;table</span></a> <span class="kw3">style</span>=<span class="st0">&quot;text-align: left; background-color: #ffffff; width: 100%;&quot;</span> <span class="kw3">border</span>=<span class="st0">&quot;1&quot;</span> <span class="kw3">cellpadding</span>=<span class="st0">&quot;2&quot;</span> <span class="kw3">cellspacing</span>=<span class="st0">&quot;0&quot;</span><span class="kw2">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/tr.html"><span class="kw2">&lt;tr&gt;</span></a></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/td.html"><span class="kw2">&lt;td&gt;</span></a></span><span class="sc2"><a href="http://december.com/html/4/element/small.html"><span class="kw2">&lt;small&gt;</span></a></span><span class="sc2"><a href="http://december.com/html/4/element/span.html"><span class="kw2">&lt;span</span></a> <span class="kw3">style</span>=<span class="st0">&quot;font-family: Tahoma;&quot;</span><span class="kw2">&gt;</span></span>Email:<span class="sc2"><span class="kw2">&lt;/span&gt;</span></span><span class="sc2"><span class="kw2">&lt;/small&gt;</span></span><span class="sc2"><span class="kw2">&lt;/td&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/td.html"><span class="kw2">&lt;td&gt;</span></a></span><span class="sc2"><a href="http://december.com/html/4/element/input.html"><span class="kw2">&lt;input</span></a> <span class="kw3">name</span>=<span class="st0">&quot;text1&quot;</span> <span class="kw3">value</span>=<span class="st0">&quot;just a test&quot;</span><span class="kw2">&gt;</span></span><span class="sc2"><span class="kw2">&lt;/td&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><span class="kw2">&lt;/tr&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/tr.html"><span class="kw2">&lt;tr&gt;</span></a></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/td.html"><span class="kw2">&lt;td</span></a> <span class="kw3">rowspan</span>=<span class="st0">&quot;1&quot;</span> <span class="kw3">colspan</span>=<span class="st0">&quot;2&quot;</span><span class="kw2">&gt;</span></span><span class="sc2"><a href="http://december.com/html/4/element/input.html"><span class="kw2">&lt;input</span></a> <span class="kw3">name</span>=<span class="st0">&quot;Submit&quot;</span> <span class="kw3">value</span>=<span class="st0">&quot;Submit&quot;</span> <span class="kw3">type</span>=<span class="st0">&quot;submit&quot;</span><span class="kw2">&gt;</span></span><span class="sc2"><span class="kw2">&lt;/td&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><span class="kw2">&lt;/tr&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><span class="kw2">&lt;/table&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc2"><span class="kw2">&lt;/form&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc2"><span class="kw2">&lt;/td&gt;</span></span><br />
&nbsp; &nbsp; <span class="sc2"><span class="kw2">&lt;/tr&gt;</span></span><br />
<span class="sc2"><span class="kw2">&lt;/table&gt;</span></span></div>
<p><span id="more-14"></span><br />
This is a typical formatting of HTML 4.0 issue, as <a target="_blank" href="http://www.w3.org/TR/REC-CSS2/sample.html">Appendix A. A sample style sheet for HTML 4.0</a> said:</p>
<div class="dean_ch" style="white-space: wrap;">FORM &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="br0">&#123;</span> <span class="kw1">margin</span>: <span class="nu0">1</span><span class="re1"><span class="re3">.33em</span></span> <span class="nu0">0</span> <span class="br0">&#125;</span></div>
<p>so the left and right margins are set to 0 and the upper and lower margins are set to 1.33em. Almost all the browsers suppress the upper margin, but not the lower one.</p>
<p>To suppress the lower one, we have 2 approaches:<br />
1. nesting the FORM tag (not the most elegant approach)<br />
2. suppress the margin from CSS</p>
<h4>1. Nesting the FORM tag</h4>
<p>We can move the FORM tag between TR and TD, and the result is:</p>
<table style="text-align: left; background-color: #336699; width: 300px;" border="1" cellpadding="2" cellspacing="0">
<tr>
<form name="example2">
<td>
<table style="text-align: left; background-color: #ffffff; width: 100%;" border="1" cellpadding="2" cellspacing="0">
<tr>
<td><small><span style="font-family: Tahoma;">Email:</span></small></td>
<td>
<input name="text2" value="just a test"></td>
</tr>
<tr>
<td rowspan="1" colspan="2">
<input name="Submit2" value="Submit" type="submit"></td>
</tr>
</table>
</td></form>
</tr>
</table>
<p>and the code is:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="sc2"><a href="http://december.com/html/4/element/table.html"><span class="kw2">&lt;table</span></a> <span class="kw3">style</span>=<span class="st0">&quot;text-align: left; background-color: #336699; width: 300px;&quot;</span> <span class="kw3">border</span>=<span class="st0">&quot;1&quot;</span> <span class="kw3">cellpadding</span>=<span class="st0">&quot;2&quot;</span> <span class="kw3">cellspacing</span>=<span class="st0">&quot;0&quot;</span><span class="kw2">&gt;</span></span><br />
&nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/tr.html"><span class="kw2">&lt;tr&gt;</span></a></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/form.html"><span class="kw2">&lt;form</span></a> <span class="kw3">name</span>=<span class="st0">&quot;example2&quot;</span><span class="kw2">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/td.html"><span class="kw2">&lt;td&gt;</span></a></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/table.html"><span class="kw2">&lt;table</span></a> <span class="kw3">style</span>=<span class="st0">&quot;text-align: left; background-color: #ffffff; width: 100%;&quot;</span> <span class="kw3">border</span>=<span class="st0">&quot;1&quot;</span> <span class="kw3">cellpadding</span>=<span class="st0">&quot;2&quot;</span> <span class="kw3">cellspacing</span>=<span class="st0">&quot;0&quot;</span><span class="kw2">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/tr.html"><span class="kw2">&lt;tr&gt;</span></a></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/td.html"><span class="kw2">&lt;td&gt;</span></a></span><span class="sc2"><a href="http://december.com/html/4/element/small.html"><span class="kw2">&lt;small&gt;</span></a></span><span class="sc2"><a href="http://december.com/html/4/element/span.html"><span class="kw2">&lt;span</span></a> <span class="kw3">style</span>=<span class="st0">&quot;font-family: Tahoma;&quot;</span><span class="kw2">&gt;</span></span>Email:<span class="sc2"><span class="kw2">&lt;/span&gt;</span></span><span class="sc2"><span class="kw2">&lt;/small&gt;</span></span><span class="sc2"><span class="kw2">&lt;/td&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/td.html"><span class="kw2">&lt;td&gt;</span></a></span><span class="sc2"><a href="http://december.com/html/4/element/input.html"><span class="kw2">&lt;input</span></a> <span class="kw3">name</span>=<span class="st0">&quot;text2&quot;</span> <span class="kw3">value</span>=<span class="st0">&quot;just a test&quot;</span><span class="kw2">&gt;</span></span><span class="sc2"><span class="kw2">&lt;/td&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><span class="kw2">&lt;/tr&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/tr.html"><span class="kw2">&lt;tr&gt;</span></a></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/td.html"><span class="kw2">&lt;td</span></a> <span class="kw3">rowspan</span>=<span class="st0">&quot;1&quot;</span> <span class="kw3">colspan</span>=<span class="st0">&quot;2&quot;</span><span class="kw2">&gt;</span></span><span class="sc2"><a href="http://december.com/html/4/element/input.html"><span class="kw2">&lt;input</span></a> <span class="kw3">name</span>=<span class="st0">&quot;Submit2&quot;</span> <span class="kw3">value</span>=<span class="st0">&quot;Submit&quot;</span> <span class="kw3">type</span>=<span class="st0">&quot;submit&quot;</span><span class="kw2">&gt;</span></span><span class="sc2"><span class="kw2">&lt;/td&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><span class="kw2">&lt;/tr&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><span class="kw2">&lt;/table&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc2"><span class="kw2">&lt;/td&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc2"><span class="kw2">&lt;/form&gt;</span></span><br />
&nbsp; &nbsp; <span class="sc2"><span class="kw2">&lt;/tr&gt;</span></span><br />
<span class="sc2"><span class="kw2">&lt;/table&gt;</span></span></div>
<h4>2. Suppress the margin from CSS</h4>
<p>We simply add <code><strong>style="margin-bottom: 0pt;"</strong></code> to the FORM tag, and the result is:</p>
<table style="text-align: left; background-color: #336699; width: 300px;" border="1" cellpadding="2" cellspacing="0">
<tr>
<td>
<form name="example3" style="margin-bottom: 0pt;">
<table style="text-align: left; background-color: #ffffff; width: 100%;" border="1" cellpadding="2" cellspacing="0">
<tr>
<td><small><span style="font-family: Tahoma;">Email:</span></small></td>
<td>
<input name="text3" value="just a test"></td>
</tr>
<tr>
<td rowspan="1" colspan="2">
<input name="Submit3" value="Submit" type="submit"></td>
</tr>
</table></form>
</td>
</tr>
</table>
<p>and the code is:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="sc2"><a href="http://december.com/html/4/element/table.html"><span class="kw2">&lt;table</span></a> <span class="kw3">style</span>=<span class="st0">&quot;text-align: left; background-color: #336699; width: 300px;&quot;</span> <span class="kw3">border</span>=<span class="st0">&quot;1&quot;</span> <span class="kw3">cellpadding</span>=<span class="st0">&quot;2&quot;</span> <span class="kw3">cellspacing</span>=<span class="st0">&quot;0&quot;</span><span class="kw2">&gt;</span></span><br />
&nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/tr.html"><span class="kw2">&lt;tr&gt;</span></a></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/td.html"><span class="kw2">&lt;td&gt;</span></a></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/form.html"><span class="kw2">&lt;form</span></a> <span class="kw3">name</span>=<span class="st0">&quot;example3&quot;</span> <span class="kw3">style</span>=<span class="st0">&quot;margin-bottom: 0pt;&quot;</span><span class="kw2">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/table.html"><span class="kw2">&lt;table</span></a> <span class="kw3">style</span>=<span class="st0">&quot;text-align: left; background-color: #ffffff; width: 100%;&quot;</span> <span class="kw3">border</span>=<span class="st0">&quot;1&quot;</span> <span class="kw3">cellpadding</span>=<span class="st0">&quot;2&quot;</span> <span class="kw3">cellspacing</span>=<span class="st0">&quot;0&quot;</span><span class="kw2">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/tr.html"><span class="kw2">&lt;tr&gt;</span></a></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/td.html"><span class="kw2">&lt;td&gt;</span></a></span><span class="sc2"><a href="http://december.com/html/4/element/small.html"><span class="kw2">&lt;small&gt;</span></a></span><span class="sc2"><a href="http://december.com/html/4/element/span.html"><span class="kw2">&lt;span</span></a> <span class="kw3">style</span>=<span class="st0">&quot;font-family: Tahoma;&quot;</span><span class="kw2">&gt;</span></span>Email:<span class="sc2"><span class="kw2">&lt;/span&gt;</span></span><span class="sc2"><span class="kw2">&lt;/small&gt;</span></span><span class="sc2"><span class="kw2">&lt;/td&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/td.html"><span class="kw2">&lt;td&gt;</span></a></span><span class="sc2"><a href="http://december.com/html/4/element/input.html"><span class="kw2">&lt;input</span></a> <span class="kw3">name</span>=<span class="st0">&quot;text3&quot;</span> <span class="kw3">value</span>=<span class="st0">&quot;just a test&quot;</span><span class="kw2">&gt;</span></span><span class="sc2"><span class="kw2">&lt;/td&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><span class="kw2">&lt;/tr&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/tr.html"><span class="kw2">&lt;tr&gt;</span></a></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/td.html"><span class="kw2">&lt;td</span></a> <span class="kw3">rowspan</span>=<span class="st0">&quot;1&quot;</span> <span class="kw3">colspan</span>=<span class="st0">&quot;2&quot;</span><span class="kw2">&gt;</span></span><span class="sc2"><a href="http://december.com/html/4/element/input.html"><span class="kw2">&lt;input</span></a> <span class="kw3">name</span>=<span class="st0">&quot;Submit3&quot;</span> <span class="kw3">value</span>=<span class="st0">&quot;Submit&quot;</span> <span class="kw3">type</span>=<span class="st0">&quot;submit&quot;</span><span class="kw2">&gt;</span></span><span class="sc2"><span class="kw2">&lt;/td&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><span class="kw2">&lt;/tr&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><span class="kw2">&lt;/table&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc2"><span class="kw2">&lt;/form&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc2"><span class="kw2">&lt;/td&gt;</span></span><br />
&nbsp; &nbsp; <span class="sc2"><span class="kw2">&lt;/tr&gt;</span></span><br />
<span class="sc2"><span class="kw2">&lt;/table&gt;</span></span></div>
<p style="font-style: italic"><strong>Conclusion:</strong><br />
The best method to suppress the vertical space after forms is to add <code><strong>style="margin-bottom: 0pt;"</strong></code> to the FORM tag.<br />
However, other methods may apply for old browsers, such as Netscape 4 (I use to call this browser as &#8220;Site-breaker&#8221;).</p>
<p><em><br />
Andrei<br />
<a href="http://www.webxpert.ro">http://www.webxpert.ro</a></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webxpert.ro/andrei/2006/01/25/how-to-suppress-extra-vertical-space-after-forms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ajax demystified</title>
		<link>http://www.webxpert.ro/andrei/2006/01/09/ajax-demystified/</link>
		<comments>http://www.webxpert.ro/andrei/2006/01/09/ajax-demystified/#comments</comments>
		<pubDate>Mon, 09 Jan 2006 08:30:32 +0000</pubDate>
		<dc:creator>andreiash</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.webxpert.ro/andrei/2006/01/09/ajax-demystified/</guid>
		<description><![CDATA[A small tutorial of Ajax (Asynchronous JavaScript and XML)]]></description>
			<content:encoded><![CDATA[<p>Nowadays everybody talks about <strong>Ajax</strong>. To be truly honest, I thought that is something extremely difficult, but it is not.<br />
It is no more than a programming technique (<strong>Asynchronous JavaScript and XML</strong>) in order to load external info in DIVs, without reloading the whole page (Gmail users probably knows best what I&#8217;m talking).</p>
<p>The reason why it was not widely used was that the <strong>XMLHttpRequest </strong>object is not supported by all browsers. Internet Explorer has his own object called <strong>XMLHTTP</strong> (as an ActiveX object).<br />
Since all new browsers have this facility, this technology (I think that calling this &#8220;Language&#8221; is not fair) exploded.</p>
<p>First of all we need to define some javascripts to create the object and handle the request. For this particular example, I used another javascript function to make the request.</p>
<div class="dean_ch" style="white-space: wrap;">&lt;script language=<span class="st0">&quot;javascript&quot;</span> &nbsp;type=<span class="st0">&quot;text/javascript&quot;</span>&gt;</p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//cross-browser object creation function</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">function</span> createRequestObject<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> ret;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//read the user&#8217;s browser </span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> browser = navigator.<span class="me1">appName</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//Internet Explorer has his own object</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>browser == <span class="st0">&quot;Microsoft Internet Explorer&quot;</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ret = <span class="kw2">new</span> ActiveXObject<span class="br0">&#40;</span><span class="st0">&quot;Microsoft.XMLHTTP&quot;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">else</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ret = <span class="kw2">new</span> XMLHttpRequest<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> ret;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//create a request object</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> http = createRequestObject<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//you will call this function</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">function</span> sendRequest<span class="br0">&#40;</span>action<span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//here&#8217;s the catch &#8211; call an external page</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http.<span class="kw3">open</span><span class="br0">&#40;</span><span class="st0">&#8216;get&#8217;</span>, <span class="st0">&#8216;req.php?action=&#8217;</span>+action<span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//wait until the request is completed</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http.<span class="me1">onreadystatechange</span> = handleResponse;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//finalize the request</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http.<span class="me1">send</span><span class="br0">&#40;</span><span class="kw2">null</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//function that handle response state changes</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">function</span> handleResponse<span class="br0">&#40;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//fires only the object change to state 4</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>http.<span class="me1">readyState</span> == <span class="nu0">4</span><span class="br0">&#41;</span><span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//get the text from the external procedure</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> response = http.<span class="me1">responseText</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw2">var</span> update = <span class="kw2">new</span> Array<span class="br0">&#40;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//parse the text</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>response.<span class="me1">indexOf</span><span class="br0">&#40;</span><span class="st0">&#8216;|&#8217;</span> != <span class="nu0">-1</span><span class="br0">&#41;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//response should be &#8216;divID|value&quot;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; update = response.<span class="me1">split</span><span class="br0">&#40;</span><span class="st0">&#8216;|&#8217;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//update the element with the divID with the value</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; document.<span class="me1">getElementById</span><span class="br0">&#40;</span>update<span class="br0">&#91;</span><span class="nu0">0</span><span class="br0">&#93;</span><span class="br0">&#41;</span>.<span class="me1">innerHTML</span> = update<span class="br0">&#91;</span><span class="nu0">1</span><span class="br0">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></p>
<p>&lt;/script&gt;</p></div>
<p>After this we need to call sendRequest function from HTML, just like this:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="sc2"><a href="http://december.com/html/4/element/a.html"><span class="kw2">&lt;a</span></a> <span class="kw3">href</span>=<span class="st0">&quot;javascript:sendRequest(&#8216;currentDateTime&#8217;)&quot;</span><span class="kw2">&gt;</span></span>update time<span class="sc2"><span class="kw2">&lt;/a&gt;</span></span></div>
<p>As you see, this example get the date from an external script (req.php), and return a string with the id of the DIV that will be updated and the value of the DIV, separated by a pipe:<br />
Below is the entire code from req.php. It&#8217;s easy, don&#8217;t it?</p>
<div class="dean_ch" style="white-space: wrap;"><span class="kw2">&lt;?</span><br />
&nbsp; <span class="co1">//test the action from request</span><br />
&nbsp; <span class="kw1">switch</span><span class="br0">&#40;</span><span class="re0">$_REQUEST</span><span class="br0">&#91;</span><span class="st0">&#8216;action&#8217;</span><span class="br0">&#93;</span><span class="br0">&#41;</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">case</span> <span class="st0">&#8216;currentDateTime&#8217;</span>:<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="co1">//return the divID and the value separated by a pipe</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <a href="http://www.php.net/echo"><span class="kw3">echo</span></a> <span class="st0">&quot;currentDateTime|&quot;</span>.<a href="http://www.php.net/date"><span class="kw3">date</span></a><span class="br0">&#40;</span><span class="st0">&quot;d/m/Y h:i:s&quot;</span><span class="br0">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">break</span>;<br />
&nbsp; <span class="br0">&#125;</span><br />
<span class="kw2">?&gt;</span></div>
<p>In the original page we need a DIV to be filled with external info</p>
<div class="dean_ch" style="white-space: wrap;"><span class="sc2"><a href="http://december.com/html/4/element/div.html"><span class="kw2">&lt;div</span></a> <span class="kw3">id</span>=<span class="st0">&quot;currentDateTime&quot;</span><span class="kw2">&gt;</span></span><br />
<span class="sc2"><span class="kw2">&lt;/div&gt;</span></span></div>
<p>The whole code from HTML file is: </p>
<div class="dean_ch" style="white-space: wrap;">
<span class="sc2"><span class="kw2">&lt;</span> !DOCTYPE html PUBLIC <span class="st0">&quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;</span> <span class="st0">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;</span><span class="kw2">&gt;</span></span><br />
<span class="sc2"><a href="http://december.com/html/4/element/html.html"><span class="kw2">&lt;html</span></a> xmlns=<span class="st0">&quot;http://www.w3.org/1999/xhtml&quot;</span> <span class="kw2">&gt;</span></span><br />
<span class="sc2"><a href="http://december.com/html/4/element/head.html"><span class="kw2">&lt;head&gt;</span></a></span><br />
<span class="sc2"><a href="http://december.com/html/4/element/title.html"><span class="kw2">&lt;title&gt;</span></a></span>Ajax demystified<span class="sc2"><span class="kw2">&lt;/title&gt;</span></span><br />
<span class="sc2"><a href="http://december.com/html/4/element/style.html"><span class="kw2">&lt;style</span></a> <span class="kw3">type</span>=<span class="st0">&quot;text/css&quot;</span><span class="kw2">&gt;</span></span><br />
A {<br />
&nbsp; color: #336699;<br />
&nbsp; text-decoration: none;<br />
&nbsp; font-weight: bold; <br />
}</p>
<p>A:hover {<br />
&nbsp; color: #FF0000;<br />
&nbsp; font-weight: bold; <br />
} </p>
<p>BODY {<br />
&nbsp; font-family: Tahoma, Verdana, Arial, sans-serif;<br />
&nbsp; font-size: 12px; <br />
}</p>
<p>.mark {<br />
&nbsp; color: #FF0000;<br />
&nbsp; font-weight: bold; <br />
}<br />
<span class="sc2"><span class="kw2">&lt;/style&gt;</span></span><br />
<span class="sc2"><a href="http://december.com/html/4/element/script.html"><span class="kw2">&lt;script</span></a> <span class="kw3">language</span>=<span class="st0">&quot;javascript&quot;</span> &nbsp;<span class="kw3">type</span>=<span class="st0">&quot;text/javascript&quot;</span><span class="kw2">&gt;</span></span></p>
<p>&nbsp; &nbsp; &nbsp; &nbsp; //cross-browser object creation function<br />
&nbsp; &nbsp; &nbsp; &nbsp; function createRequestObject() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var ret;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //read the user&#8217;s browser <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var browser = navigator.appName;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //Internet Explorer has his own object<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(browser == &quot;Microsoft Internet Explorer&quot;){<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ret = new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; else{<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ret = new XMLHttpRequest();<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return ret;<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; //create a request object<br />
&nbsp; &nbsp; &nbsp; &nbsp; var http = createRequestObject();<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; //you will call this function<br />
&nbsp; &nbsp; &nbsp; &nbsp; function sendRequest(action) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //here&#8217;s the catch &#8211; call an external page<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http.open(&#8216;get&#8217;, &#8216;req.php?action=&#8217;+action);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //wait until the request is completed<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http.onreadystatechange = handleResponse;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //finalize the request<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; http.send(null);<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; //function that handle response state changes<br />
&nbsp; &nbsp; &nbsp; &nbsp; function handleResponse() {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //fires only the object change to state 4<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(http.readyState == 4){<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //get the text from the external procedure<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var response = http.responseText;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var update = new Array();<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //parse the text<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(response.indexOf(&#8216;|&#8217; != -1)) {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //response should be &#8216;divID|value&quot;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; update = response.split(&#8216;|&#8217;);<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; //update the element with the divID with the value<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; document.getElementById(update[0]).innerHTML = update[1];<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; }</p>
<p><span class="sc2"><span class="kw2">&lt;/script&gt;</span></span><br />
<span class="sc2"><span class="kw2">&lt;/head&gt;</span></span></p>
<p><span class="sc2"><a href="http://december.com/html/4/element/body.html"><span class="kw2">&lt;body</span></a> <span class="kw3">onload</span>=<span class="st0">&quot;javascript:sendRequest(&#8216;currentDateTime&#8217;)&quot;</span><span class="kw2">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; This page shows how Ajax is working. Is is nothing fabulous here. <br />
&nbsp; &nbsp; &nbsp; &nbsp; </p>
<p>&nbsp;Click here for <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class="sc2"><a href="http://december.com/html/4/element/a.html"><span class="kw2">&lt;a</span></a> <span class="kw3">href</span>=<span class="st0">&quot;javascript:sendRequest(&#8216;currentDateTime&#8217;)&quot;</span><span class="kw2">&gt;</span></span>update time<span class="sc2"><span class="kw2">&lt;/a&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><a href="http://december.com/html/4/element/div.html"><span class="kw2">&lt;div</span></a> <span class="kw3">id</span>=<span class="st0">&quot;currentDateTime&quot;</span> <span class="kw3">class</span>=<span class="st0">&quot;mark&quot;</span><span class="kw2">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="sc2"><span class="kw2">&lt;/div&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
Nothing else but the date and time is updated.<br />
&nbsp; &nbsp; &nbsp; &nbsp; </p>
<p>
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc1">&amp;copy;</span>2006 <span class="sc2"><a href="http://december.com/html/4/element/a.html"><span class="kw2">&lt;a</span></a> <span class="kw3">href</span>=<span class="st0">&quot;mailto:andrei@webxpert.ro&quot;</span><span class="kw2">&gt;</span></span>Andrei DANEASA<span class="sc2"><span class="kw2">&lt;/a&gt;</span></span><br />
<span class="sc2"><span class="kw2">&lt;/body&gt;</span></span><br />
<span class="sc2"><span class="kw2">&lt;/html&gt;</span></span></div>
<p>If you want to see this example working and test it, click <a href="/andrei/wp-content/ajax" target="_blank">here</a>. </p>
<p><em>*This is not intended to be a complete tutorial of Ajax, but it covers the main functionalities. The rest is only programmer&#8217;s imagination.</em><br />
<em><br />
Andrei<br />
<a href="http://www.webxpert.ro">http://www.webxpert.ro</a></em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.webxpert.ro/andrei/2006/01/09/ajax-demystified/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rounded-border textbox</title>
		<link>http://www.webxpert.ro/andrei/2005/12/20/rounded-border-textbox/</link>
		<comments>http://www.webxpert.ro/andrei/2005/12/20/rounded-border-textbox/#comments</comments>
		<pubDate>Tue, 20 Dec 2005 11:22:21 +0000</pubDate>
		<dc:creator>andreiash</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[rounded textbox]]></category>

		<guid isPermaLink="false">http://www.webxpert.ro/andrei/2005/12/20/rounded-border-textbox/</guid>
		<description><![CDATA[How to make an textbox look rounded-border]]></description>
			<content:encoded><![CDATA[<p><em>*You could probably also want to read the second version of this article <a href="http://www.webxpert.ro/andrei/2006/10/20/rounded-border-textbox-ii/">here</a></em></p>
<p>Did you ever want a fancy textbox like this one ?</p>
<p><img src='/andrei/wp-content/aloha_login.jpg' alt='Rounded-border textbox' border='1'/><br />
<br />
I&#8217;m sorry, but HTML and CSS does not support this kind of appearance. You should use a trick in order to look like this by creating a background with a rounded textbox drawn. Then you should create a html textbox input with no border, smaller than the drawn textbox.<br />
The CSS style for this textbox is the following:</p>
<div class="dean_ch" style="white-space: wrap;"><span class="re1">.textbox</span> <span class="br0">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">font-family</span>: Verdana, Arial, Helvetica, <span class="kw2">sans-serif</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">font-size</span>: <span class="re3">11px</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">margin</span>: <span class="re3">0px</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">padding</span>: <span class="re3">2px</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">border</span>: <span class="re3">0px</span> <span class="kw2">none</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">width</span>: <span class="re3">150px</span>;<br />
<span class="br0">&#125;</span></div>
<p><em><br />
Andrei<br />
<a href="http://www.webxpert.ro">http://www.webxpert.ro</a></em></p>
<p><strong>Read also</strong></p>
<li><a href="http://www.webxpert.ro/andrei/2006/10/20/rounded-border-textbox-ii/">Rounded-border textbox II</a></li>
]]></content:encoded>
			<wfw:commentRss>http://www.webxpert.ro/andrei/2005/12/20/rounded-border-textbox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

