這個還不錯用, 也不用再你的blog加一些有的沒的外掛, 掛久了你也都不記的到底你掛了哪些套件了, 真的是這樣子XD...
BJ4了
{
"name": "jsbin",
"age": 99,
"birthday": "1988/02/02",
"mails": {"home": "hotmail@mail.com", "work": "yahoo@mail.com"},
"phones": {"mobile": "0923456789", "home": "048353868" }
}
$.ajax({
url: 'http://jsbin.com/dijeyodote/2/edit?js',
dataType: 'json',
success: function(data) {
var json_str=JSON.stringify(data);
var json = JSON.parse(json_str);
alert(json.phones.mobile);
}
});
"""建立hi_dict的dictionary"""
hi_dict = {'name': '王小明', 'age': 25, 'mail': 'sample@gmail.com'}
"""取得某key的值"""
print hi_dict.get('name')
"""或"""
print hi_dict['name']
"""加入一組 key 與 value"""
add_dict = {'blog','http://myblog.com'}
hi_dict.update(add_dict)
"""或"""
hi_dict.update({'blog','http://myblog.com'})
"""移除一組 key 與 value"""
hi_dict.pop('blog') """若key 'blog' 不存在時會回傳, KeyError: 'bolg' 訊息"""
"""複製dict"""
hi_dict2=hi_dict.copy()
var hello = function () {
//再也不會搞不清楚是數字或英字大小寫 1,i,l,0,o,O
var my_array = ["1", "i", "l", "0", "o", "O"];
}
$(function () {
var dlg = $("#testDialog").dialog();
dlg.parent().appendTo(jQuery("form:first"));
});
<meta content='10' http-equiv='Refresh'/> <meta content='10' URL='http://tw.yahoo.com' http-equiv='Refresh'/>