philihp.com

Tag: HTML

Please stop creating links with target=”_new”.

Just stop. This is wrong; instead, use this: target=”_blank” I don’t know who started these nasty rumors that “_new” would open up in a new browser. As far back as I can tell, no browser has ever recognized “_new”. The whole point of the target dates back to when browsers used frames to split up your [...]

CSS even/odd row selectors! Finally!

IE9 has been released, and it finally includes the “nth-child” pseudo-selector in CSS! In the past, this has been done on a server side, or with javascript. Now we finally have simple CSS rules for rows in tables that highlight every even or odd row, and it works in every browser without any hacks. tr:nth-child(odd) [...]

Sending HTTP Requests without Reloading and without AJAX

Supposing I have a simple HTML form that looks like this: <form method=”post” action=”/SomeServlet”> <input type=”text” name=”message” value=”Hello Server” /> <input type=”submit” value=”Send” /> </form> And supposing I have a Servlet mapped at the path /SomeServlet, consisting of the code: public class SomeServlet extends HttpServlet { protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException [...]

Two notes about RESTful services

In RESTful protocols, HTTP methods correspond to actions on a resource. Most commonly the four HTTP methods PUT, GET, POST, and DELETE are used to implement CRUD actions. PUT vs. POST People often mistakenly equate POST with Update and PUT with Create. For an exact definition, check the HTTP 1.1 RFC, but generally speaking… PUT [...]