上一页 1 2 3 4 5 6 7 8 9 10 ··· 12 下一页
摘要: objectjavascript也是面向对象的语言,与其他的面向对象语言例如C++类似。每个对象包含的变量称为property,函数则成为method。constructor构造函数也与c++类似,this表示对象本身function Blog(who, what, when, where){ ... 阅读全文
posted @ 2014-09-10 10:07 Jolin123 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Strings>>> s = 'django is cool'>>> words = s.split()>>> words['django', 'is', 'cool']>>> ' '.join(words)'django is cool'>>> s.count('o')3>>> s.find('g... 阅读全文
posted @ 2014-09-08 20:31 Jolin123 阅读(497) 评论(0) 推荐(0) 编辑
摘要: 访问页面元素访问页面元素通常的一个做法是给标签加上一个id,然后可以通过getElementById()函数来实现,如:...var sceneDescription = document.getElementById("scenetext")还有一种方法是通过标签的名字来进行访问,getEleme... 阅读全文
posted @ 2014-08-30 21:43 Jolin123 阅读(185) 评论(0) 推荐(0) 编辑
摘要: 每个表格输入都有一个form对象可以作为参数,如:...function showIt(theForm){ alert(theForm["zipcode"].value);} this.form表示该表格的form对象作为参数被传进函数,在showIt()函数中用"zipcode"来引用这个对... 阅读全文
posted @ 2014-08-29 12:12 Jolin123 阅读(178) 评论(0) 推荐(0) 编辑
摘要: if语句if ( test condition ) statement1;else statement2;// comments/* comments ... */script level:直接在里面声明的变量相当与全局变量,可以直接在每个函数里面访问。在函数里面生命的变量只能在该函数... 阅读全文
posted @ 2014-08-27 17:55 Jolin123 阅读(170) 评论(0) 推荐(0) 编辑
摘要: setTimeout, 单位是毫秒setTimeout ( time code, timer delay );eg:setTimeout("alert('wake up!')", 100000);The document object表示网页代码本身修改用户窗口(不是整个浏览器)的大小,可以用bod... 阅读全文
posted @ 2014-08-23 07:53 Jolin123 阅读(172) 评论(0) 推荐(0) 编辑
摘要: three basic data typestextnumberboolean变量var var_name;用'='初始化变量var var_name = ini_value;const (不是所有浏览器都支持const)const const_name = ini_value;NaN: not a... 阅读全文
posted @ 2014-08-19 23:25 Jolin123 阅读(163) 评论(0) 推荐(0) 编辑
摘要: 网页需要更好的交互体验,仅仅有html和css当然不够,因此javascript粉末登场 ...onload : 页面加载完成之后会出发onload eventalert() : 插入一些提示信息example:在页面加载完成之后提示'Hello, world',可以发现调用函数的方式... 阅读全文
posted @ 2014-08-16 22:18 Jolin123 阅读(299) 评论(0) 推荐(0) 编辑
摘要: 题目链接:Sicily 1090思路:简单的最小生成树问题,这里用prim算法即可。用visited数组记录每个结点是否已经被访问,即是否已经在最小生成树中。每次从不在最小生成树中的结点中取出一个key值最小的结点放入生成树中,key值表示结点到已经在生成树中点集合的最小距离。每次加入一个结点后更新... 阅读全文
posted @ 2014-08-15 18:18 Jolin123 阅读(258) 评论(0) 推荐(0) 编辑
摘要: python3之前的版本用Tkinter,之后用的是tkinter最简单的使用Tkinter的代码,首先要Tk()建立一个窗口,然后加进各种Widgetfrom Tkinter import *window = Tk()label = Label(window, text = "Welcome to... 阅读全文
posted @ 2014-08-12 10:17 Jolin123 阅读(1236) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 12 下一页