2016 - 1 - 27 javaScrip初步(一)
<head>
</head> <body>
<!-- The onclick attribute is the code
that happens when the element is clicked.
The value of the attribute is some
javascript code.
In this case it creates an alert
pop up dialog
-->
<h1 id="title" onclick="alert('hello');" >
Hello
</h1>
</body>
<head>
</head>
<body>
<!--
In this case the onclick functions
writes something to the console.
The console is an object so we use the
dot (.) notation to call a function
on it
-->
<h1 id="title"
onclick="console.log('hello');" >
Hello
</h1>
</body>
I don't know does the code " console.log('hello') " whether means make a object(console) do sth.?
2.How to use the jQuery
<head>
<!-- to use jQuery we need to import it like this -->
<script src=" http://code.jquery.com/jquery-1.11.3.min.js"></script>
</head>
<body>
<!--
in this example use use jQuery to
change the content itself.
The $ is shorthand for the jQuery function
We are passing in a CSS selector which
gets this element by its id.
The html function sets the html content
of an element
-->
<h1 id="title" onclick="$('#title').html('Goodbye');">
Hello
</h1>
</body>
3.How to define a function in javaScript
<head>
<script src = "http://code.jquery.com/jquery-1.11.3.min.js"></script>
</head> <body>
<h1 id="title" onclick="sayHello()"> Hello </h1>
</body>
<!--
the script tag is where you can put
more complex scripts
-->
<script type="text/javascript"> function sayHello() {
alert('Hello');
};
</script>
2016 - 1 - 27 javaScrip初步(一)的更多相关文章
- 2016.9.27 --- changchun
1001 Hanzo vs. Genji 1002 Fraction 1003 Rotate String 1004 Triangle 1005 The Fastest Runner Ms. Zhan ...
- 2016 - 1 - 25 CSS初步 (二)
1.The customising link We can change the link's style when we move our pointer on the link like that ...
- 2016 08 27 印刷菜单增加sql语句
insert into `module` (`ID`, `CONSONANTCODE`, `CREATEDATE`, `DESCRIPTION`, `HANDLER`, `HASCHILD`, `IC ...
- 2016.8.27 JavaScript入门之四
1.比较运算符“>”也可以,用数字和字符串进行比较: 2.比较运算符“&&”,表示并且: 3.比较运算符“||”,表示或者: 4.顺序是重要的,循环和if判断的顺序决定了,程序的 ...
- 2016.5.27 php测试中敏感度高,怎么调整
在测试PHP代码的过程中,会遇到这样的问题:PHP提示Notice: Undefined variable,遇到这样的问题很纠结,但是很容易解决. 今天晚上,我就遇到了这样的问题,到网上搜索了很多解决 ...
- 2016.5.27 Kal系统安装到U盘的方法,U盘启动Kali
本文我们聊一下如何把Kali Linux安装到移动硬盘或者U盘上,由移动硬盘独立引导,与本地系统完全隔离.U盘随身携带,只要PC的Bios支持USB启动,走到哪都可以使用自己的移动系统,方便工作和学习 ...
- Day3~Day7(2016/1/23~2016/1/27)
活动的生命周期:onCreate();onStart();onResume();onPause();onStop();onDestroy();onRestart(); 活动的启动模式:standard ...
- 2016 - 1 - 24 CSS初步
1.The difference between CSS and HTML HTML document is that it specities the content of the page. An ...
- 27、初步探索echarts源码
1.首先发现随笔中凡是和echarts相关的点击率都特别高,于是乎就接着写了echarts因为感觉要转点击率 首先声明我并不是专业做前端的,所以如果有些说得不对的地方,希望前端大神们出来指正 首先发现 ...
随机推荐
- 【转】Centos升级Python 2.7.12并安装pip、ipython
Centos系统一般默认就安装有Python2.6.6版本,不少软件需要2.7以上的,通过包管理工具安装不了最新的版本,通过源码编译可以方便安装指定版本,只需要把下面版本的数字换成你想要的版本号. 1 ...
- 【Duke-Image】Week_4 Image restoration
Chapter 5 Image Restoration and Reconstruction 图像复原与重建 5.1 A Model of the Image Defradation/Restorat ...
- caffe安装过程中遇到的问题以及解决方法
1. 在安装依赖库的时候,遇到: @gxjun-Latitude-E5440:~$ sudo apt-get install libatlas-base-dev 正在读取软件包列表... 完成 正在分 ...
- 网站第三方登陆(一) QQ登陆
QQ 登陆是指,通过qq的用户名和密码,登录网站,不需要注册,网站的用户名和密码.如下图 一旦你授权了,就可以进入网站了,要实现这个效果 1.去qq互联平台(http://connect.qq.com ...
- 基于jstree的 对混乱的 命名系统进行归类的 计算机软件
本人现在就职于一家加拿大东部餐饮连锁公司的IT部门,公司旗下有4个品牌,280多家餐厅. 所有的餐厅都使用maitred 的pos软件来处理收银结账. 公司总部使用business object 对m ...
- Hibernate与MyBatis
一. Hibernate与MyBatis Hibernate 是当前最流行的O/R mapping框架,它出身于sf.net,现在已经成为Jboss的一部分. Mybatis 是另外一种优秀的O/R ...
- WCF初探-26:WCF中的会话
理解WCF中的会话机制 在WCF应用程序中,会话将一组消息相互关联,从而形成对话.会话”是在两个终结点之间发送的所有消息的一种相互关系.当某个服务协定指定它需要会话时,该协定会指定所有调用(即,支持调 ...
- hdoj 1576
//1Y真是爽啊 题意:要求(A/B)%9973,但由于A很大,我们只给出n(n=A%9973)(我们给定的A必能被B整除,且gcd(B,9973) = 1). 分析:根据题意a=b*x a=m ...
- AsyncTask
package com.gg.test; import java.io.IOException; import org.apache.http.HttpResponse;import org.apac ...
- Request和response的用法总结
Request 个我总结:只要记住 只要是有关于客户端请求的信息,都可以藉由它来取得,例如请求标头.请求方法.请求参数.使用者IP等等信息. 3.什么情况下为响应?什么情况下为请求? 简单一句话,请求 ...