Tuesday, 26 June 2012

html5test.com


your browser scores

402

AND 13 BONUS POINTS

out of a total of 500 points
You are using Chrome 19 on Windows 7Correct?
Parsing rules+2 bonus points11
<!DOCTYPE html> triggers standards modeYes 
HTML5 tokenizerYes 
HTML5 tree buildingYes 
HTML5 defines rules for embedding SVG and MathML inside a regular HTML document. Support for SVG and MathML is not required though, so bonus points are awarded if your browser supports embedding these two technologies.
SVG in text/htmlYes 
MathML in text/htmlYes 
Canvas20
canvas elementYes 
2D contextYes 
TextYes 
Video+6 bonus points21/31
video elementYes 
Subtitle supportNo 
Poster image supportYes 
The following tests go beyond the requirements of the HTML5 specification and are not counted towards the total score. If browser support for one or more video codecs is detected, two bonus points are awarded for each codec.
MPEG-4 supportNo 
H.264 supportYes 
Ogg Theora supportYes 
WebM supportYes 
Audio+5 bonus points20
audio elementYes 
The following tests go beyond the requirements of the HTML5 specification and are not counted towards the total score. If browser support for one or more audio codecs is detected, one bonus point is awarded for each codec.
PCM audio supportYes 
AAC supportYes 
MP3 supportYes 
Ogg Vorbis supportYes 
WebM supportYes 
Elements25/30
Embedding custom non-visible dataYes 
New or modified elements
Global attributes or methods
hidden attributeYes 
Forms74/108
Field types
Fields
Forms
User interaction37
Drag and drop
HTML editing
Spellcheck
spellcheck attributeYes 
History and navigation5
Session historyYes 
Microdata0/15
MicrodataNo 
Web applications18/20
Application CacheYes 
Custom scheme handlersYes 
Custom content handlersNo 
Custom search providersYes 
Security5/15
Sandboxed iframeYes 
Seamless iframeNo 
iframe with inline contentsNo 
Various4/6
Scoped style elementNo 
Asyncronous script executionYes 
Runtime script error reportingYes 
Base64 encoding and decodingYes 

related specifications

Location and Orientation20
GeolocationYes 
Device OrientationYes 
WebGL25
3D contextYes 
Communication37
Cross-document messagingYes 
Server-Sent EventsYes 
WebSocketYes 
Files20
FileReader APIYes 
FileSystem APIYes 
Storage20
Session StorageYes 
Local StorageYes 
IndexedDBYes 
The Web SQL Database specification is no longer being updated and has been replaced by IndexedDB. Because at least 3 vendors have shipped implementations of this specification we still include it in this test.
Web SQL DatabaseYes 
Workers15
Web WorkersYes 
Shared WorkersYes 
Local multimedia0/20
Access the webcamNo 
Notifications10
Web NotificationsYes 
Other7
Page VisibilityYes 
Text selectionYes 
Scroll into viewYes 

experimental

Audio4
Web Audio APIYes 
Video and Animation4
Full screen supportYes 
window.requestAnimationFrameYes 
id: 1340703277922_c2df

Friday, 15 June 2012

Create in-page navigation with id attributes

Initially i thought that linking to anchor element can possible with name attribute of anchor element like this....
<a href="#targetlocation">......</a>
...........................................
...........................................
<a name="targetlocation">........................</a>



but i was  wrong we can do in-page navigation with id attributes as well like this
We can  put an id attribute on an  any element like <a> element, to make it into a page anchor,<div> element,heading element and so on. You then reference that ID in the href attribute of another link to link to it. For example:
<h2><a id="sec1">Section #1</a></h2>
Could be linked to by
<a href="#sec1">Section One</a>
But most browsers you'll want to support these days allow you to write a shortcut for this, and put the ID directly on the element you want to link to, for example:
<h2 id="sec1">Section #1</h2>

Till this knowledge it is ok 4 me but I surprised while working on a task that taget linking using "name attribute" not works for Chrome.So I used "id" attribute to resolve this problem and my problem had solved out......but still "picture abhi baki thi".........Id attribute was not working on Explorer....However any of the two ways works fine for Firefox. From this observation, I had to use both method so that it could work fine in all browsers like this.....

<a href="#targetlink">............................</a>

...............................
...............................
.......................
<div id="targetlink">.................</div>
<div  reason="Internet explorer bug fix"><a name="targetlink">&#160;</a></div>  //reason attribute is given to give information for developers why this extra tag is there however we can give any xyz  name other than reason.

...............................

Conclusion :

The name attribute has been deprecated in the XHTML 1.0 spec.so better to use "id" attribute
So, this would be a better option, as it would work for HTML 4.01, XHTML 1.0 and HTML 5.
.

Tuesday, 12 June 2012

Bookmarks

difference in display:inline,display:block and float


Every browser has a "flow". The flow sort of emulates a word processor in that elements flow from left to right, top to bottom. Elements that do not fit at the end of a "line", wrap to the next "line", so to speak.
Block elements take up the full line. Inline elements only take up as much space as they need, so other elements can sit next to them on the same line. Unless there is a width declared, that doesn't happen with block elements.
Floating an element takes the elements out of the normal flow and shifts it to the left/right. The space that the object occupied before it was floated is empty, and collapses. If I float two elements that take up more space than the line can hold, one may fall to the next "line".
displaying two spans inline will put them together in the flow, 
If I wanted to have text flow around an image in a paragraph, I would float the image not usedisplay:inline. If I wanted to create a horizontal menu from list item elements, I would usedisplay:inline, not float.


display:inline means a element is will "stack" next to other items, like images, spans or the bold tag. This is opposed by block level elements (display:block) which take up horizontal space, imply a line break, and will not sit next to one another, like divs, paragraphs, or tables.
Think of it this way...
<img /><img /><img />
<div />
<div />
<div />
ex-
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
p.inlineDemo {display:inline}
p.blockDemo {display:block}
p.floatDemo {float:left}
</style>
</head>
<body>

<p class="inlineDemo">These two paragraphs generates inline boxes, and it results in</p>

<p class="inlineDemo">no distance between the two elements(With a single space).</p>

<p class="blockDemo">These two paragraphs generates block boxes, and it results in</p>

<p class="blockDemo">seperate line between the two elements.</p>

<p class="floatDemo">These two paragraphs generates float boxes, and it results in</p>

<p class="floatDemo">no space between the two elements.</p>

</body>
</html>
Output:


These two paragraphs generates inline boxes, and it results in
 
no distance between the two elements(With a single space).
These two paragraphs generates block boxes, and it results in
seperate line between the two elements.
These two paragraphs generates float boxes, and it results in
no space between the two elements

ex-
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
p.inlinel {display:inline; width: 4em;}
p.inliner {display:inline; width: 4em; text-align: right;}

p.floatl {width: 4em; float:left;}
p.floatr {width: 4em; float: right;}
</style>
</head>
<body>

<p class='inlinel'>The is an inline paragraph with lots of words.</p>
<p class='inliner'>The is an inline paragraph with lots of words.</p>

<br/><br/>

<p class='floatl'>The is a left floated paragraph with lots of words.</p>
<p class='floatr'>The is a right floated paragraph with lots of words.</p>


</body>
</html>
Output :

The is an inline paragraph with lots of words.
 
The is an inline paragraph with lots of words.
 
The is a left floated paragraph with lots of words.
The is a right floated paragraph with lots of words.

Saturday, 9 June 2012

email validation function


function emailValidate()
{
alert("hhhhhhhhhhhhhhhhh");

var email = document.getElementById('emailaddressID');

var filter = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
if (!filter.test(email.value))
//The test() method tests for a match in a string.
This method returns true if it finds a match, otherwise it returns false
{
alert('Please provide a valid email address');

email.focus();
return false;
}