What are the Three Layers of Web Development?
- Content or Structure
The calm or structure covering is what your readers are entrance to get when they come to your Web page. Content can include of calm or images and includes the pointers that your readers need to navigate around your Web site. In Web development, XHTML creates adult the calm covering and it also structures the Web document. - Style or Presentation
The character or display covering is how the request will demeanour to your readers. This covering is tangible by the CSS or styles that prove how your request should be displayed and on what media types. - Behavior
The function covering is the covering of a Web page that does something. If we use Ajax or DHTML, it is the JavaScript that creates the page do something. If we have a PHP or CGI back-end, it is the PHP or CGI scripts that take movement when your reader clicks something. For many Web pages, the initial turn of function is the JavaScript interactions on the page.
Why Should You Separate the Layers?
When you’re formulating a Web page, it is critical to keep the layers separate. As we forked out in , regulating outmost character sheets is the best approach to apart your calm from your design. And the same is loyal for regulating outmost JavaScript files.
Some of the advantages of separating the layers are:
- Shared resources
When we write an outmost CSS record or JavaScript file, we can use that record by any page on your Web site. There is no duplication of effort, and whenever the record changes, it changes for each page that uses it though we creation some-more than one change. - Faster downloads
Once the book or stylesheet has been downloaded by your patron the initial time, it is cached. Then each other page that is downloaded loads some-more fast in the browser window. - Multi-person teams
If we have some-more than one chairman operative on a Web site during once, we can order adult the effort though worrying about permissions or calm management. You can also sinecure people who are style/design experts to work on the CSS while your scripters work on the JavaScript, and your writers work in the calm files. - Accessibility
External character sheets and book files are some-more permitted to some-more browsers, since they can be abandoned some-more easily, and since they yield some-more options. For example, we can set adult a character piece that is displayed usually for shade readers or a book library that’s usually used by people on dungeon phones. - Backwards compatibility
When we have a site that is designed with the growth layers, it will be some-more retrograde concordant since browsers that can’t use record like CSS and JavaScript can still perspective the HTML. Your Web site can afterwards be prorgressively extended with facilities as browsers support them.
XHTML – the Content Layer
The calm covering is where we store all the calm that your business wish to review or demeanour at. This includes calm and images as good as multimedia.
It’s critical that your calm covering be as standards-compliant as we can make it, possibly it’s HTML or XHTML. That way, it will combine some-more simply with your character and function layers. we strongly suggest regulating current XHTML (either transitory or strict) since that is the many present calm covering record and will set your site adult to be serviceable good into the future.
When we use current XHTML that provides clearer hooks into the calm for your styles and behaviors to squeeze onto. For example, in HTML, the divide tab (p) doesn’t need an finish tag. Most of the time this isn’t a problem, though some browsers might appreciate the finish of a divide in a opposite plcae than we expect. And when your styles are applied, your page will demeanour wrong. Just regulating the finish divide tab (/p) tells the browser accurately where we design the divide and any compared styles to end.
It’s also critical to make certain that each aspect of your site is represented in the calm layer. That way, your business who have JavaScript incited off or can’t perspective CSS will still have entrance to the whole site, if not all the functionality.
CSS – the Styles Layer
Store all your styles for your Web site in an outmost character sheet. This defines the approach the pages should look, and we can have apart character sheets for several media types.
Store your CSS in an so that we can get the advantages of the character covering opposite the site.
JavaScript – the Behavior Layer
JavaScript is the many ordinarily used denunciation for essay the function layer, though as we mentioned before, CGI and PHP can also beget Web page behaviors. However, when many developers impute to the function layer, they meant that covering that is activated directly in the Web browser – so JavaScript is scarcely always the denunciation of choice. You use this covering to correlate directly with the or Document Object Model. Writing current XHTML in the calm covering is also critical for DOM interactions in the function layer.
When we build in the function layer, we should use outmost book files only like with CSS. You get all the same advantages of regulating an outmost character sheet.





You must log in to post a comment.