JavaScript II: How to achieve the separation of JAVASCRIPT/CSS and HTML __mysql

Source: Internet
Author: User
Tags save file

The steps to implement JAVASCRIPT/CSS and HTML are very similar and, of course, different, followed by specific implementations.

The first step: Create files First

Only the files created are different. The following figure

1 if creating JavaScript code with HTML separate file creation:

A) Select JavaScript page type

b Displays the created file, placing the code in the <script language= "JavaScript" type= "Text/javascript" ></script> framework into the created file

(Remember: Do not put the frame code into the file, the HTML in the framework and the contents of all clear)

c) Save file: Name the file, the type of file is:. js file.

2 If creating CSS code with HTML separate file creation:

A) Select the CSS page type

(b) Display the created file and place the contents of the <stysle type= "Text/css" inside the file (Ibid. does not include frame code, which clears the frame and content in HTML)

c) Save file: Name the file, the type of file is:. css file.

Step Two: Introduce our saved files in HTML

1 introduce. js files in HTML:

Find the imported files, others are the default options, and of course in HTML you need to place the cursor in the location where the file is introduced.

2 introduce. css files in HTML:

Find the imported files, others are the default options, and of course in HTML you need to place the cursor in the location where the file is introduced.

Summary:

Two big strides can realize the separation of javascript/css and HTML, and realize the reusability of code.

I seem to have: "Different problems to find the same point, the same problem to find a different point." "Use it; through these two examples, this type of problem can be solved in two parts."


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.