Home > front end >  Javascript introduction with the necessary knowledge
Javascript introduction with the necessary knowledge

Time:12-04


~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
DW and javascript development tools and key technology:
Author: Sirius
Time to write: 2020.12.3
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
1. The properties, applications of javascript

JavaScript is belong to the network of scripting language!
JavaScript is a lightweight programming languages,
JavaScript is the programming code can be inserted into the HTML page,
JavaScript inserted into the HTML page, can be carried out by all modern browsers,
JavaScript is millions of web pages to improve design, verification form, detect browser, create cookies, and more applications,
JavaScript is the Internet's most popular scripting language,
This language can be used for HTML and web, more can be widely used in server, PC, laptop, tablet and smart phone devices, such as
JavaScript is easy to use! You will like it!

2. The website about learning javascript
Javascript is a necessary language for front-end engineer, it can realize the function, realize the most we need
So for the web, so the w3c is necessary, we learn knowledge, of course, he provides the basis of free tutorials to allow us to clear understanding of the knowledge, also have a variety of off-line manual, covering almost all mainstream technology and language, if you need the detailed teaching please log on to the w3c begin your learning path
3. The javascript necessary knowledge

A. in the HTML script must be in & lt; script> With & lt;/script> Tags,
Scripts can be placed in HTML page & lt; body> And & lt; head> In part,
Such as: & lt; script>
My First JavaScript alert (" ");
</script>

Page: & lt; ! Doctype html>


<meta charset="utf-8">
Javascript exercise


<body>

<script>
Document. Write (" & lt; H1 & gt; This is a headingDocument. Write (" & lt; p> This is a paragraph

" );

</script>



B. when we need in a number of different web pages using javascript, we can keep the script in external files, any & lt; script> Label the SRC file path, in order to reference the javascript file, we need
The extension of the suffix for external javascript file. Js
Example:


<body>
<script SRC="https://bbs.csdn.net/topics/Script.js" & gt; </script>



C. the JavaScript function and event
JavaScript statements in the example above, you will be executed when the page is loaded,
Usually, we need to execute code when a certain event occurs, such as when the user clicks the button,
If we put the JavaScript code in the function, we can call this function when events occur,

D. the JavaScript function is placed into the HTML page & lt; head> Part,
This function will be invoked when click the button:
Example:



<script>
The function myFunction ()
{
Document. The getElementById (" en "). The innerHTML="My First JavaScript exercise";
}
</script>


<body>










E.J avaScript function into the HTML page & lt; body> Part,
Similar to the above example is only a place in the
This function will be invoked when click the button:
Instance


<body>






<script>
The function myFunction ()
{
Document. The getElementById (" en "). The innerHTML="My First JavaScript exercise";
}
</script>




This article represent only personal point of view, we do not guarantee the correctness of the content, the copyright, all rights reserved - Sirius

  • Related