JavaScript 方法[1]

encodeURIComponent # 对连接进行escape

JSON.stringify()

这篇文章: 有用 无用 创建 2016-12-14 14:25:27 / 更新 2016-12-19 07:16:27

JavaScript DOM 学习[2]

document.title
document.baseURI    
document.URL
document.documentURI
document.referrer
document.domain

document.body                  # Returns the <body> element
document.documentElement           # Returns the <html> element
document.cookie

document.scripts                   # Returns all <script> elements
document.forms
document.links                     # Returns all <area> and <a> elements that have a href attribute

这篇文章: 有用 无用 创建 2016-10-27 10:37:49 / 更新 2016-10-27 10:40:34

JavaScript DOM 学习[1]

http://www.w3schools.com/js/js_htmldom.asp

# DOM(Document Object Model)

# The document object represents your web page.

# If you want to access any element in an HTML page, you always start with accessing the document object.

# The innerHTML property can be used to get or change any HTML element, including <html> and <body>.

# document.getElementById(id)
# document.getElementsByTagName(name)
# document.getElementsByClassName(name)

# element.innerHTML =  new html content
# element.attribute = new value
# element.setAttribute(attribute, value)
# element.style = new style

<html>
<body>

<p id="demo">Hi</p>

<script>
alert(document.getElementById("demo").innerHTML);
document.getElementById("demo").innerHTML = "Hello World!";
</script>

</body>
</html>

这篇文章: 有用 无用 创建 2016-10-27 02:01:56 / 更新 2017-02-07 19:58:21

JavaScript 如何捕获匹配数据

var myString = "something format_abc";
var myRegexp = /format_(.*?)/;
var match = myRegexp.exec(myString);
console.log(match[1]); // abc

这篇文章: 有用 无用 创建 2016-10-26 11:17:41 / 更新 2017-02-07 19:58:28