codecamp

Copyright

书名: 《Python Cookbook》3rd Edition
作者: David Beazley, Brian K. Jones
译者: 熊能
版本: 第3版
出版社: O’Reilly Media, Inc.
出版日期: 2013年5月08日
Copyright © 2013 David Beazley and Brian Jones. All rights reserved.

更多发布信息请参考 http://oreilly.com/catalog/errata.csp?isbn=9781449340377

原文地址:http://python3-cookbook.readthedocs.org/zh_CN/latest/

前言
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }