Ding Yu education Chengdu Java Training institutions Learn JavaScript 4 questions to note
1. About JavaScript Pseudo-protocol: Call JavaScript functions through a link, such as:
Link Example
Role: Pseudo-protocol-enabled JavaScript, calling JavaScript function disadvantages via links: Browsers that need support for JAVASCIRPT functionality
JavaScript Browser not supported: Open Failure Support but disable JavaScript browser: do nothing
2. About JavaScript inline events, triggered by some events, such as OnClick, for example:
Link Example
Cons: With JavaScript pseudo-protocol, no fallback is reserved
3. Why to reserve a retreat (Chengdu Java Training which good)
JavaScript-disabled users are very few, but not completely excluded (such as an important customer is in it), and search engine use of JavaScript support is not very good, no fallback will make the search engine ranked behind
Based on the unfriendly use of JavaScript by search engines, JavaScript should not be allowed to add important content to a Web page (that is, do not misuse dom,innerhtml to add important content). But still need to use, weigh with, degree of grasp is always the world's most difficult to deal with a problem.
Digression: Ajax is also a search engine support is not friendly (in fact, it should be the search engine for AJAX support is not friendly), but the problem still needs to understand, after all, SEO is not to be overlooked (should pay attention to) the problem
4. How to properly handle JavaScript
--->javascript and HTML separation: write JavaScript as a function, encapsulate it in an external file, and let the HTML call (of course, you need to set the hooks in HTML)
--->javascript function: Detects if the browser supports Javacript, such as:
Before using document.getElementById, detect:
if (!document.getelementbyid) return False;
--->java training institutions the usual important content can be handled like this:
Using some HTML tags to display on the page, and then using the DOM to extract information from the document, and then re-insert that information in a clear and meaningful way into the document and so on, and so on, but these for me personally, most of the rest in the theoretical part, It is necessary to practice constantly to strengthen the perfection of thought and the way to deal with problems.
http://www.scdingyu.cn/
http://www.scdingyu.cn/kcdq/java/
http://java.scdingyu.com/
Ding Yu education Chengdu Java Training institutions Learn JavaScript 4 questions to note