jQuery学习笔记1

jQuery学习笔记1 开始之前:http://docs.jquery.com/ 是jQuery文档的网站, https://jsfiddle.net/是js的在线验证工具。 1.首先复习一下html, css, js三个文件的协同作用 html负责内容elements和骨架tags,div css负责格式样式大小、颜色等 js负责动作效果,操作html JQuery是一个面向javascript的工具库,基于DOM-Document Object Model文档对象模型,通过使用jQuery可以方便实现效果。 1.1-html包含css与JavaScript的基本骨架代码 1. <!DOCTYPE html> 2. <html> 3. <head> 4. <title></title> 5. <link rel="stylesheet" type="text/css" href="stylesheet.css"/> 6. <script type="text/javascript" src="script.js"></script> 7. </head> 8. <body> 9. <div id="red" ></div> 10. </body> 11. </html> 2.好,让我们开始接触jQuery Getting Started Next, we’ll need to start up our jQuery magic using the $(document).ready(); syntax you’ve seen. It works like this: 1. $() says, "hey, jQuery things are about to happen!"是把()内的东东转化成jQuery的object,从而有后面的.ready这个method 2. Putting document between the parentheses tells us that we're about to work our magic on the HTML document itself.

READ MORE

Javascript学习笔记2

Javascript学习笔记2 before we get started, let’s review the way we Create a Class: 开始之前,我们先复习一下Class的建立方式: function Person(name,age) { this.name = name; this.age = age; } // Let's make bob again, using our constructor var bob = new Person("Bob Smith", 30);* 1 * 2 * 3 * 4 * 5 * 6 * 7 1.注入method into Class Prototype to Rescue – 实际是注入method into Class,要注意对比独立于Class之外的function也能实现类似的。不过原理不同。 比如: function Dog (breed) { this.breed = breed; }; var bark = function(){ //这种就是独立于class之外的,与后面object就无关了。 console.log("Woof"); }; // here we make buddy and teach him how to bark var buddy = new Dog("golden Retriever"); //Dog.

READ MORE

Linux驱动程序安装步骤(包括PC上及开发板上)

Linux驱动程序安装步骤(包括PC上及开发板上) 来源:http://blog.csdn.net/hwmt2012/article/details/13016213 分类: LINUX 一.PC机上Ubuntu9.10系统下 驱动程序源码及Makefile如下: #——源程序——# #include <linux/module.h> #include <linux/init.h> static int __init hello_init()//“__init”使hello_init()函数放到初始化代码段里 { printk(“Hello, driver!\n”); return 0; } static int __exit hello_exit() { printk(“Goodbye, driver!\n”); return 0; } module_init(hello_init); module_exit(hello_exit); #——Makefile——# KVERS = $(shell uname -r) Kernel modules obj-m += hello.o Specify flags for the module compilation. #EXTRA_CFLAGS=-g -O0 build: kernel_modules kernel_modules: make -C /lib/modules/$(KVERS)/build M=$(CURDIR) modules clean: make -C /lib/modules/$(KVERS)/build M=$(CURDIR) clean 2.驱动程序编译、安装及结果显示: a.在第一个终端里 root@book-desktop:~# make //生成hello.ko b.在第二个终端里 root@book-desktop:~# tail -f /var/log/messages //查看日志文件内容,-f选项使之不断刷新显示 c.在第一个终端里 root@book-desktop:~# insmod .

READ MORE

JavaScript在线集成开发环境IDEs和在线学习工具

JavaScript在线集成开发环境IDEs和在线学习工具 来源: http://en.wikipedia.org/wiki/Online_JavaScript_IDE 所以要多用wikipedia啊。。。。 在线集成开发环境: cloud9 codenvy koding.com pastebin 在线学习工具: codecademy.com www.w3school.com.cn jisuanke.com jikexueyuan.com 在线调试工具: http://jsfiddle.net/ 参考:http://www.ruanyifeng.com/blog/2012/02/6_online_playgrounds_for_web_developing.html Online JavaScript IDE From Wikipedia, the free encyclopedia An online JavaScript IDE (or browser based JavaScript IDE, JavaScript live coding environment, web playground, JavaScript sandbox) is an integrated development environment (IDE) that is hosted in a browser, with an aim to ease JavaScript, HTML, and CSS based web development. Generally, they allow users to edit JavaScript code in the browser, and see the results of executing the code.

READ MORE

Javascript 学习笔记1

Javascript 学习笔记1 所有有“注意”的地方都是曾犯过的错误,要Ctrl+F搜索出来反复强化。 了解几个固有功能: 1. myString.substring(1,2); //extract substring 2. confirm("Do you want to continue?"); //ask user for confirm 3. prompt("What's your age?"); //ask user for type in 4. console.log("Hello worldd!"); //Print out the content 5. var myVariable; //declare a variable 6. declare a function: //声明一个函数: var myFunktion = function(input_num){ var val = input_num/3; console.log(val); }; // use myFunktion: myFunktion(6); //又如:======== var greeting = function(name){ console.log("Great to see you," + " my dear " + name); }; greeting("sonictl"); =========================== 7. 声明一个空数组: var hits = []; 8.

READ MORE

Linux配置和管理msyql命令

配置和管理msyql: 1. 修改mysql最大连接数:cp support-files/my-mediuf,vim my.cnf,增加或修改max_connections=1024 关于my.cnf:mysql按照下列顺序搜索my.cnf:/etc,mysql安装目录,安装目录下的data。/etc下的是全局设置。 2. 启动mysql:/usr/local/mysql/bin/mysqld_safe –user=mysql & 查看mysql版本:mysqladmin -u root -p version 注:网上安装或者二进制安装的可以直接使用如下命令启动和停止mysql: /etc/init.d/mysql start|stop|restart 3. 停止mysql:mysqladmin -uroot -ppassw0rd shutdown 注意,u,p后没有空格 4. 设置mysql自启动:把启动命令加入/etc/rc.local文件中 5. 允许root远程登陆: 1)本机登陆mysql:mysql -u root -p (-p一定要有);改变数据库:use mysql; 2)从所有主机:grant all privileges on . to root@"%" identified by "passw0rd" with grant option; 3)从指定主机:grant all privileges on . to root@"192.168.11.205" identified by "passw0rd" with grant option; flush privileges; 4) 进mysql库查看host为%的数据是否添加:use mysql; select * from user; 6. 创建数据库,创建user: 1) 建库:create database test1; 2) 建用户,赋权:grant all privileges on test1.

READ MORE

干净win7要做几步才能运行第一个Spring MVC 写的动态web程序

干净win7要做几步才能运行第一个Spring MVC 写的动态web程序: 1. 下载安装jdk 2. 配置Java环境变量 3. 测试一下第1,2两步是否完全成功:http://jingyan.baidu.com/article/14bd256e2e3e0cbb6d261201.html 3. 下载安装Eclipse J2EE luna(一定要是j2EE版本,否则会有jar包缺失引起internal error,补起来很麻烦) 4. 在Eclipse中安装Spring Tool Suite(不要纠结SpringIDE与SpringToolSuite的区别,STS就好。)          Help >> Eclipse Marketplace >> Search: Spring Tool Suite >> Install the one that matches. 5. 下载解压Tomcat:  http://tomcat.apache.org/download-80.cgi          选择符合你机器的版本和格式进行下载,解压放在你喜欢的路径下。 6. 配置tomcat环境变量:          配置Tomcat环境变量          1,新建变量名:CATALINA_BASE,变量值:C:\tomcat          2,新建变量名:CATALINA_HOME,变量值:C:\tomcat          3,打开PATH,添加变量值:%CATALINA_HOME%\lib;%CATALINA_HOME%\bin          参考:http://jingyan.baidu.com/article/8065f87fcc0f182330249841.html 7. 为了能方便调试,Eclipse设置Tomcat运行环境:          Window >> Preferences >> Server >> Runtime Environment >> Add.

READ MORE