close

簡單認識Javascript

我依舊從這網站看的,就慢慢看過去,也沒有把他背起來的意思XDD裡面的例子也可以練習~

網址:http://www.w3schools.com/js/

常用的就用橘字顯示囉!好啦~也算是自己的偷備份阿哈哈

 

他有提到為什麼要學JS

Why Study JavaScript?

JavaScript is one of the 3 languages all web developers must learn:

   1. HTML to define the content of web pages

   2. CSS to specify the layout of web pages

   3. JavaScript to program the behavior of web pages

This tutorial is about JavaScript, and how JavaScript works with HTML and CSS.

雖然我有很多的原因需要學他必須要學他,但我就這樣這副德性愛理不理的,嗚嗚嗚

我覺得我能把這網頁的看完就很了不起了!!!我相信大家也是XDDDD畢竟這網頁講得真的有夠簡單了!就靠他來認識JS吧!

 

★通常常用的就是怎麼載入他

<!DOCTYPE html>
<html>
<body>
<script src="myScript.js"></script>
</body>
</html>

還有JS他可以在<head> or <body>,不過最好養個好習慣讓他在同個地方。

<script>
document.getElementById("demo").innerHTML = "My First JavaScript";
</script>

希望我也有這個好習慣阿哈哈哈哈

不過我發現網頁若使用太多js會造成頁面載入太慢的話,使用外部連結會更棒,也順便分離html跟JS的程式碼使閱讀更加容易。

 

 

每天一點點看總會看完的吧!!!!

2015/06/29 JS HOME > JS Syntax

2015/06/30 JS statements > JS variables

感覺一直KEY 到  document.getElementByID("xxx").innerHTML=XXX;

a = 5; b = 6; c = a + b;

★雖然有時候後面沒有分號還是可以work,但算是養成一種好習慣吧!

var person = "Hege";
var person="Hege";

JS會忽略空格,可使用空格增加可讀性,常用於運算子( = + - * / ) 

 

這個表格裡的東西算是最常見的!!!對我來說

Keyword Description
break Terminates a switch or a loop
continue Jumps out of a loop and starts at the top
debugger Stops the execution of JavaScript, and calls (if available) the debugging function
do ... while Executes a block of statements, and repeats the block, while a condition is true
for Marks a block of statements to be executed, as long as a condition is true
function Declares a function
if ... else Marks a block of statements to be executed, depending on a condition
return Exits a function
switch Marks a block of statements to be executed, depending on different cases
try ... catch Implements error handling to a block of statements
var Declares a variable

今天看好慢XD

 

★註解也蠻常用的

// JS單行註解

/* JS單行註解 or JS多行註解 */

 

2015/7/2 JS operators > JS scope

function name(parameter1, parameter2, parameter3) {
    code to be executed
}

 

You can access object properties in two ways:

objectName.propertyName 

objectName[propertyName]

 

2015/7/6 JS events > JS strings

★這個表格裡的東西算是最常見的!!!對我來說

Here is a list of some common HTML events:

Event Description
onchange An HTML element has been changed
onclick The user clicks an HTML element
onmouseover The user moves the mouse over an HTML element
onmouseout The user moves the mouse away from an HTML element
onkeydown The user pushes a keyboard key
onload The browser has finished loading the page

 

 

2015/7/7 JS String Methods > Js String Methods

發現算術系列超討厭-.-結果看超慢

2015/7/8 Js Numbers > Js Math

Number Properties

Property Description
MAX_VALUE Returns the largest number possible in JavaScript
MIN_VALUE Returns the smallest number possible in JavaScript
NEGATIVE_INFINITY Represents negative infinity (returned on overflow)
NaN Represents a "Not-a-Number" value
POSITIVE_INFINITY Represents infinity (returned on overflow)

2015/7/15 Js Dates > Js Arrays

Syntax:

var array-name = [item1item2, ...];       

2015/7/22 Js Array Methods > Js Booleans

我的媽呀我沒想到我拖到2016還是沒看完真夭壽,真敗給自己的拖拖拉拉

2016/01/27  JS Comparison

2016/01/28  JS Conditions 

這篇介紹最常見的if else

JS Switch 

2016/01/30

JS loop for

 

2018/05/24

JavaScript Type Conversion

2018/05/29

JS Bitwise

2018/07/26

JS RegExp

JS Errors

throw 可以自訂錯誤訊息

2018/08/01

JS Scope

2018/09/06

JS Hoisting

JS Strict Mode

JS this Keyword

JS Let

JS const

JS Debugging    console.log(); debugger;

JS Style Guide

2018/10/08

JS Best Practices

JS Mistakes

JS Performance

JS Reserved Words

JS Versions

2018/10/17

ECMAScript 5 - JavaScript 5

ECMAScript 5 - JavaScript 6

JS JSON

2018/11/21

JS Forms

Forms API

JS object

JS Funtions

> arguments.length用法,哇賽我看到之前完全沒用過QQ

> call()這個很常用到

> apply()

2018/11/27

HTML DOM

>> querySelector & querySelectorAll

>> DOM event 常用

>> DOM event listener 常用

JS Brower BOM

>> JS Window Location 

>> JS Popup Alert

>> JS Timing(setTimeout, clearTimeout)

>> JS Cookies

2018/11/29

JS AJAX 這個超重要,一定會用到絕對會用到

2018/11/30

JS JSON 這個也很重要,也常用到,而且JSON比XML好用很多

JS vs JQuery 其實JQuery把JS變得更簡單了,但發現很多套件還是以JS為基底,所以原生JS還是要很懂比較好。

 

哇靠我超有病,我看超久才看完。嗚嗚嗚嗚

但發現看完真的又更懂伊些呢!!!

arrow
arrow
    文章標籤
    Javascript JS
    全站熱搜

    Kaikai凱開 發表在 痞客邦 留言(2) 人氣()