i++,++i,Math.max,hasOwnPrototype.ajax,indexOf(),firefox的一些东西,jquery的contains函数,window.open
一、i++与++i的区别
1 var i=0;3 console.log(i++)5 0
1 var j=0;
2 3 console.log(++j)
4 1
a=++i;相当于i=i+1;a=i;
a=i++;相当于a=i;i=i+1;
二、Math.max
var arr=[1,3,4,45,5,6,6,7]
undefined
Math.max(arr[0],arr[1],arr[2],arr[3],arr[4],arr[5],arr[6],arr[7])
45
Math.max.call(Math,arr[0],arr[1],arr[2],arr[3],arr[4],arr[5],arr[6],arr[7])
45
Math.max.apply(Math,arr)
45
三、hasOwnPrototype与isPrototypeOf
hasOwnProperty: 是用来判断一个对象是否有你给出名称的属性或对象。不过需要注意的是,此方法无法检查该对象的原型链中是否具有该属性,该属性必须是对象本身的一个成员。
isPrototypeOf : 是用来判断要检查其原型链的对象是否存在于指定对象实例中,是则返回true,否则返回false。
四、ajax
var str='asaa';
undefined
str.indexOf('aa')
2
大范围的string在前面,需要搜索的字符串在后面,就是大在前,小在后,然后返回的匹配的索引值
<html>
<head>
<meta charset='UTF-8'>
<title>sd</title>
<style>
html,body{
margin:0;
padding:0;
}
#div1{
float: left;
background-color: red;
width:40%;
height:200px; }
#div2{
background-color: green;
width:200px;
height:214px;
background-image: url('BC0C62C1B1962A8A.jpg');
} </style>
</head>
<body>
<div id='div1'>
<div id='div2'>
</div>
</div>
</body>
</html>

#div1{
float: left;
background-color: red;
width:40%;
/*height:200px;*/
}
#div2{
background-color: green;
width:200px;
height:214px;
background-image: url('BC0C62C1B1962A8A.jpg');
}

2.当设置为三列布局的时候,firefix的float宽度也是100%;
九、jquery contains()
jQuery( ":contains(text)" )
text: A string of text to look for. It's case sensitive.
<div>John Resig</div>
<div>George Martin</div>
<div>Malcom John Sinclair</div>
<div>J. Ohn</div>
$( "div:contains('John')" ).css( "text-decoration", "underline" )
十、window.open()
var windowObjectReference = window.open(strUrl, strWindowName, [strWindowFeatures]);
strUrl- The URL to be loaded in the newly opened window.
strUrlcan be HTML, an image file, or any other resource supported by the browser. strWindowName- A name for the new window. The name can be used as the target of links and forms using the
targetattribute of<a>or<form>elements. The name should not contain whitespace. Note thatstrWindowNamedoes not specify the title of the new window. strWindowFeatures- An optional parameter listing the features (size, position, scrollbars, etc.) of the new window as a string. The string must not contain any whitespace, and each feature name and value must be separated by a comma. See Position and size features below for details.
i++,++i,Math.max,hasOwnPrototype.ajax,indexOf(),firefox的一些东西,jquery的contains函数,window.open的更多相关文章
- JS Math.max() 函数
Math.max(a,b,...,x,y) -- 返回数个数字中较大的值 max是maximum的缩写,中文"最大量"的意思 max函数语法Math.max(a,b,...,x,y ...
- js取最小最大值--Math.min()、math.max()
一.Math.min() 返回一组表达式中最小者 eg: var n = Math.min( 2 , 30 ,1 , 200-10 , 300*22 , 20-30 ); alert(n); //打印 ...
- 如何用Math.max.apply()获取数组最大/小值
最近似乎对JavaScript有点兴趣了~~~打算好好钻研这个东西.可是,一开始就遇到问题了!!! Math.min.apply(obj,args);//这个obj对象将代替Function类里thi ...
- Math.max()/min()
返回一组数中最大值: 找到数组中的最大值,有两种方法,一种是apply,一种使用拓展运算符. 释义: 由于max()里面参数不能为数组,所以借助apply(funtion,args)方法调用Math. ...
- 复习C#的方法Math.Max和Math.Min
温故而知新,今天学习Math.Max和Min的方法.这2个方法,均需要传入2个参数,返回参数中最大值和最小值. class Ac { public void LeanMathFunction() { ...
- Math.max.apply(null,arr)求最大值
1.首先了解一下call和apply call 和 apply 的第一个参数是null/undefined时函数内的this指向window 或global call/apply 用来改变函数的执行上 ...
- Math.max得到数组中最大值
Math.max(param1,param2) 因为参数不支持数组. 所以可以根据apply的特点来解决, var max = Math.max.apply(null,array),这样就可以轻易的得 ...
- 找出数字数组中最大的元素(使用Math.max函数)
从汤姆大叔的博客里看到了6个基础题目:本篇是第1题 - 找出数字数组中最大的元素(使用Match.max函数) 从要求上来看,不能将数组sort.不能遍历.只能使用Math.max,所以只能从java ...
- Java控制语句例题,for循环语句,if条件语句等,Scanner类与Random类,Math.max()方法
例题:编写程序,生成5个1至10之间的随机整数,并打印结果到控制台 import java.util.Random;class demo09 { public static void main(Str ...
随机推荐
- 分析优秀的.NET 文档设计工具Vsdocman 7.1 软件保护技术
Vsdocman是一个优秀的.NET源代码注释编写工具,方便的以GUI的方式设计.NET源代码的注释. 我们知道.NET源代码的注释是Xml格式的注释,在生成程序集时,只需用选中生成Xml注释,Vis ...
- Android引导页设计
大家在安装好一个应用后,第一次打开时往往会出现一个使用引导页,形式一般为三.四张图片,随着我们的滑动进行切换,在最后一页会有一个进入应用的按钮,我们通过点击这个按钮可以进入应用,其实这其中没有太多的复 ...
- 专业IT培训机构-传智播客
http://user.qzone.qq.com/1467400757/blog/1414135584
- 【GIT】使用Git命令窗口将本地工程提交至远程GitHub
目标: 1.解决的问题是如何通过Git命令窗口将本地工程提交至GitHub. 2.方便园友的同时也方便自己以后解决此类问题. 步骤: 1.首先登陆GitHub网站https://github.com/ ...
- java设计模式(三)--抽象工厂模式
转载:http://zz563143188.iteye.com/blog/1847029 前面的工厂方法模式虽然清晰,但还是感觉有些繁琐,通常使用的还是抽象工厂模式. 工厂方法模式有一个问题就是,类的 ...
- Linux安装配置tomcat
1.首先配置好jdk 查看java版本:java -verson 1.官网下载jdk 2.tar -zxvf xxxx.tar.gz 解压 3.配置环境变量 <1># vi /etc/ ...
- 开源服务专题之--------mysql的编译安装
为什么选择MySQL 1:mysql性能卓越,服务稳定,很少出现异常宕机 2:mysql开源免费,无版权制约,自主性及使用成本低 3:产品耦合度,mysql支持多种操作系统,支持多开发语言,特别是ph ...
- 如何解读SQL Server日志(2/3)
接下来说说返回的RowLogo Content列,例子中返回了三个列.这些列包含了数据操作的"有效工作负载(Playload)"记录.根据不同操作类型有效负载的内容也是不同的,但是 ...
- [译]学习IPython进行交互式计算和数据可视化(二)
第一章:开始使用IPython 在本章中,我们首先进行一遍IPython的安装过程,在大概浏览一下IPython提供的功能.IPython提供了一个高度优化的Python控制台和Notebook.除此 ...
- node.js中使用https请求报CERT_UNTRUSTED的问题解决
只要调用了没有受信的https就会报错:CERT_UNTRUSTED 简单的解决方法就是设置环境变量回避非授信证书的问题. 只要在请求的代码之前加上如下代码即可: process.env.NODE_T ...