Prototype.js formElmt.request() and non-valid HTML

Handy and pretty $('myform').request() can be easily broken if you have really broken HTML. For example:

<form id="myform">
  <input />
  <input />

$('myform').serialize() will return empty string for such html. As a result you’ll have ajax request with no parameters, obviously not what you’ve expected. Fix html and everything will work.

Friday, May 16th, 2008

How to skip image alignment in WordPress and HTML

For example, you have posted picture with left alignment. And thus all the text is starting from the right side of the picture. How to skip this if you want only part of text to be from the side of the image?

You can use multiple <br> tags, but this is not a good idea in WordPress. It is not working there. It is not good for HTML also, because representation can be different for different browsers, displays etc. There is special parameter for <br> tag, which skip all image alignment. This is <br clear=”all”>

Thursday, February 14th, 2008

Printing tags in an html pages.

  Usually, Html file consists of many special tags like <a>, <br> etc. And if you need to print html tags in text of your web page (for example when you want to display html source code on web page), you can’t write them directly in your html file. Because in that case your browser will interpret them as html tags and will not shown them correctly. Thus, it’s better to use &amp;lt; and &amp;gt; instead of < and > correspondingly. For example, if you need to display <table> tag, you need to write &amp;lt;table&amp;gt;
  But how to display &amp;lt; or &amp;gt; in html? You can use &amp;amp; instead of & symbol. For example, you need to display &amp;lt;. Then you should write &amp;amp;lt; in your html file.

  In general, if you want to display &amp;amp;amp;amp;lt; or something like this, you need to write in your html the same sequence but with replaced & symbol with &amp;amp;. In this case it will be &amp;amp;amp;amp;amp;lt;

  In WordPress you should use +1 more amp; phrase, because it replace all &amp;amp; with the & in Code mode.

Saturday, December 29th, 2007