Kurinchi Blogger Scribbles …


Archive for the ‘HTML’ Category

Dec 06
2009

HTTP-Header: User-agent modification

Last updated: December 5th, 2009

When a browser makes a request to the server, it sends information such as its operating system name, version in addition to the type of the browser from which the request originates in the header variable “user-agent”.

Depending on the request made, server responds back with specific details which can range from browser specific css layout to calling certain javascriptsfor certain browsers.

Changing the user-agent also helps us in understanding how spider-agents or bots will see the pages that we build. It also helps us design applications that will mimic a request as originating from a mobile phone and helps us in viewing the behavior of the application in different mobile clients.

To read more about HTTP-Headers check ietf

Nov 17
2009

Firefox: Developer Friendly Browsing Tool

Last updated: November 16th, 2009

Firefox is one of the best tool available for web developers which equips the developer with code testing and debugging capabilities.

There are many useful firefox options and extensions that comes in handy during software development life cycle and in this article we will be listing few of useful plugins that we commonly use.

To find information related to the page that is getting displayed on the browser click Tools > Page info. This will give you permission settings of a page, security identity of the page, feed url and other page specific information like page content-type, encoding, meta tags used, cookie permission settings etc.

Web Developer extension
Added as a toolbar in firefox, this extension gives CSS related information, page information, outlines page elements, tab index, gives topographic information and many such details.
(more…)

Nov 10
2009

Query string limit in GET data and Size limit in POST Data

Last updated: November 11th, 2009

RFC 2616 – Section 3 states:

“Servers should be cautious about depending on URI lengths above 255 bytes because some older client or proxy implementations may not properly support these lengths.”

Different browser agents support different URI length acceptance. In addition, servers too play a role in accepting/denying URI’s over certain length which may either truncate the URI or may give lengthy URI message indications.

It is always advisable to rely on shorter URI’s and to post data when more field sets are to be transferred across web pages.

POST data too has its limit. In this case, it is the size of the data which is controlled by the server settings.

Some interesting discussions:

Limit on query string GET URL parameters

Sep 05
2009

How to open ALL external web sites or references in a NEW window?

Last updated: September 24th, 2009

Using JQuery to open external links in new windows

Earlier we used to write a string of code in javascript to enable opening external references in a new window in addition to modifying the html code

With JQuery, this can be done with one line of code as shown below

$(document).ready(function(){
    $("a[@href^='http']").attr('target','_blank');
});

The above line checks for occurences http in a tag and if a link has “http” in it, JQuery opens the link in a NEW window.

According to W3C standards, the target attribute has been removed from xhtml 1.1 specification.

Sample script to open external links in New Window

<!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" xml:lang="en-GB">
<head>
<script src="js/jquery-1.3.2.min.js" type="text/javascript"></script>
<script language="javascript">
$(document).ready(function(){
    $("a[href^='http']").attr('target','_blank');
});
</script> 
</head>
<body>


Testing the pages - Open Links in new <a href="http://yahoo.com">window</a>.

<h1><a href="http://www.kurinchilion.com">Kurinchilion</a></h1>
</body>
</html>
Jun 09
2009

cakePHP: Session enabled messages using Session->setFlash

Last updated: June 9th, 2009

There are different ways to flash or publish the messages for a user action. Usability plays a major role in determining how the navigation pattern for a web application takes place.

  • publishing the outcome of user action on the same page
  • designing a single page to flash all success, error, warning, notice level messages
  • designing a separate page for each message that gets published for the user

(more…)


Valid HTML 4.01 Strict  Valid HTML 4.01 Strict