View Single Post
Old 10-07-2011, 12:25 PM   #3
oi1yum4ei6ku
Commander In Chief
 
Join Date: Oct 2010
Posts: 964
oi1yum4ei6ku is on a distinguished road
Default

| Back to logs list

33705 2009 年 04 月 17 日 17:55 Reading (loading. ..) Comments (0) Category: Javascript
non-invasive scripting (unobtrusive scripting) it means to CSS-based, standards-compliant scripting Javascript WEB site of the new application ideas.
non-invasive script includes the following features:
it should be available. That give the site brings the benefits of the availability of specific features. It should be accessible. If Javascript is invalid, the page should still be able to read and understandable,red wing shoes sale, even inevitable loss of some usability. It should be easy to achieve. A typical situation: WEB developers only need to introduce the script in the page itself and a Javascript hook (hook), then the script can run. It should be separate. It only exists in. Js files, so that the package modules, rather than scattered in every corner of HTML. Separation of the view that draw on come from the CSS change,red wing shoes, to separate HTML and CSS, Javascript that will be separated from the two is logical.
a WEB page has the following three components: HTML structural layer, CSS and Javascript behavior layer presentation layer.
HTML structure of the skin layer is of all things, must be attached to other things in it to survive. HTML tags form the page structure and give meaning to the page content. The purpose of CSS is to define the presentation layer to show us how to HTML. Javascript behavior layer to cross into the HTML / CSS page. The client code is divided into three layers also leads to another topic, namely,red wing boots, separation of concerns. Do the most basic requirement is to ensure that: HTML is structured,red wing motorcycle boots, not too complicated,red wing shoes online, but in no case of CSS and Javascript to be meaningful; CSS and Javascript behavior layer presentation layer were placed in the. Css files and. Js files ; In addition, the separation so that you can change the CSS presentation layer, giving your site a new design, but not by rewriting HTML structure, they do not rewrite the Javascript behavior layer.

three separate

is the so-called three separate: the separation performance and structure (CSS and HTML); behavior and structure of the separation (Javascript and HTML); behavior and performance of the separation (Javascript and CSS). A clear understanding of the relationship between the three, will always affect us all aspects of the preparation of the modern Javascript.
separation performance and structure of the (CSS and HTML) I think we should discuss in more appropriate WEB standard section, here is not recorded.

behavior and structure of the separation (Javascript and HTML)

easier to understand: not to write any Javascript code in HTML pages. In fact, HTML pages are mostly from within Javascript code event handler associated composition. Here,red wing work boots, the focus that the next javascript: pseudo-protocol
Sometimes we often see a similar javascript: pseudo-protocol link.



Code highlighting produced by Actipro CodeHighlighter (freeware) href = \obscure code secret defines a onclick event handler. Proper event handling design should be separated, such as:

Code highlighting produced by Actipro CodeHighlighter (freeware) <a href=\;

/ / in a separate. js files

Code highlighting produced by Actipro CodeHighlighter (freeware) 'do'). onclick = dosomthing;

for the href attribute said, or just let it contains a URL address so that disabled users can continue to access the script, or to generate the Javascript to the links. Separation of behavior and performance
(Javascript and CSS)

separation than the first two much more complex in the modern Javascript programming, this separation eyes of the beholder, the wise see wisdom. The basic question is: what effect should be defined with CSS? And what should be Javascript? While the answer seems obvious: the performance with CSS, behavior with Javascript. CSS and Javascript but in fact there is a gray area coincidence can not be clearly classified as an effect the performance or behavior.
===== === continued
oi1yum4ei6ku is offline   Reply With Quote

Sponsored Links