Jesse's Blog

不管怎样,明天又是全新的一天。

0%

0 Activity的类文件

活动
  • 实例

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    Button button = (Button)findViewById(R.id.button);
    button.setOnClickListener(new View.OnClickListener() {
    @Override
    public void onClick(View v) {
    Toast.makeText(MainActivity.this, "You click the button", Toast.LENGTH_SHORT).show();
    finish(); // 销毁一个活动
    sendMessage(v);
    }
    });
    }
  • 创建一个Button对象实例

    1
    Button button = (Button)findViewById(R.id.button);
    阅读全文 »

BOM

浏览器窗口尺寸

  • 两个属性:
    1. innerWidth
    2. innnerHeight
  • 共同点:包含滚动条的尺寸,除了Mac的Safari

浏览器弹出层

  1. alert(‘提示文本’)
  2. confirm(‘提示文本’)
  3. prompt(‘提示文本’)

获取时间对象

1
2
3
4
5
// 当前时间对象
var time = new Date()
// 创建指定时间
var time = new Date(2030, 11) // 至少2个参数,除了年之外每个数字自动进位
var time = new Date('2090/11/29 12/34/14') // 还可以传入:yyyy-mm-dd HH-MM-SS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
var time = new Date()
var year = getFullYear() // 年
getMonth() // 月
getDate() // 日
getHours() // 时
getminutes() // 分
getSeconds() // 秒
getMilliseconds() //毫秒
getDay() // 星期几,number类型,0 是周日
// 时间戳
getTime()
//获取世界标准时间
getUTCFullyear()
...
getUTCmilliseconds()
阅读全文 »

行内式

<a href="javascript: alert('hello world')">点我</a>

<div onclick="alert('hello world')">点我</div>

内嵌式

可以放在页面任何位置

链入式

<script src="/xxx.js"></script>
此时写在标签内的内容不会执行

输出

key bindings

ShortKeys Description
Ctrl+Alt+V 在选定的文本上创建或粘贴剪贴板的内容作为内联链接。
Ctrl+Alt+R 创建或粘贴剪贴板的内容作为引用链接。
Shift+Win+K 创建或将剪贴板的内容作为内联图像粘贴到选定的文本上。
Alt+B Alt+I 这些必须是粗体和斜体。有选择和没有选择都适用。如果没有选择,他们只会转换光标下的单词。
Ctrl+1…6 这些将为标题添加相应数量的哈希标记。与上述标题工具一起处理空行和选定文本。如果您选择一个完整的现有标题,当前的哈希标记将被删除并替换为您请求的标题级别。这个命令尊重mde.match\头\哈希首选项设置。
Alt+Shift+6 插入脚注。
Shift+Tab 折叠/展开当前节。
Ctrl+Shift+Tab 将所有章节折叠到某一级别的标题下。
Ctrl+Alt+Shift+PageUp Ctrl+Alt+Shift+PageDown 转到相同或更高级别的上一个/下一个标题
Ctrl+Shift+PageUp Ctrl+Shift+PageDown 转到上一个/下一个标题
Ctrl+Shift+H 打开主页
Ctrl+Shift+D 在光标下打开wiki页面
Ctrl+Shift+J 打开今天的日记页
Ctrl+Shift+B 列出反向链接
阅读全文 »

Welcome to Hexo! This is your very first post. Check documentation for more info. If you get any problems when using Hexo, you can find the answer in troubleshooting or you can ask me on GitHub.

Quick Start

Create a new post

1
$ hexo new "My New Post"

More info: Writing

Run server

1
$ hexo server

More info: Server

Generate static files

1
$ hexo generate

More info: Generating

Deploy to remote sites

1
$ hexo deploy

More info: Deployment