Ding Yu education Chengdu Java Training institutions Learn JavaScript 4 questions to note

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.