一、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

ajax() 方法通过 HTTP 请求加载远程数据。$.ajax(opts);opts为json格式,常见参数url、type、data等。
 
load() 方法从服务器加载数据,并把返回的数据放入被选元素中。$(selector).load(URL,data,callback);
必需的 URL 参数规定您希望加载的 URL。
可选的 data 参数规定与请求一同发送的查询字符串键/值对集合。
可选的 callback 参数是 load() 方法完成后所执行的函数名称。
 
$.get() 方法通过 HTTP GET 请求从服务器上请求数据。
$.get(URL,callback);
必需的 URL 参数规定您希望请求的 URL。
可选的 callback 参数是请求成功后所执行的函数名。
 
getScript() 方法通过 HTTP GET 请求载入并执行 JavaScript 文件。
jQuery.getScript(url,success(response,status));
 
 
五、
javascirpt中的数字在计算机内存储为8Byte
 
六、
Readonly只针对input(text/password)和textarea有效,而disabled对于所有的表单元素有效,包括select,radio,checkbox,button等。
 
七、indexOf()
 var str='asaa';
undefined
str.indexOf('aa')
2

大范围的string在前面,需要搜索的字符串在后面,就是大在前,小在后,然后返回的匹配的索引值

八、firefox
 1.如果父级的高度固定了的话,firefix的div的内嵌div不可以把父级的高度撑大;
  如果父级的高度没有设置的话,firefix的div的内嵌div可以把父级的高度撑大;
 <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. strUrl can 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 target attribute of <a> or <form> elements. The name should not contain whitespace. Note that strWindowName does 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的更多相关文章

  1. JS Math.max() 函数

    Math.max(a,b,...,x,y) -- 返回数个数字中较大的值 max是maximum的缩写,中文"最大量"的意思 max函数语法Math.max(a,b,...,x,y ...

  2. js取最小最大值--Math.min()、math.max()

    一.Math.min() 返回一组表达式中最小者 eg: var n = Math.min( 2 , 30 ,1 , 200-10 , 300*22 , 20-30 ); alert(n); //打印 ...

  3. 如何用Math.max.apply()获取数组最大/小值

    最近似乎对JavaScript有点兴趣了~~~打算好好钻研这个东西.可是,一开始就遇到问题了!!! Math.min.apply(obj,args);//这个obj对象将代替Function类里thi ...

  4. Math.max()/min()

    返回一组数中最大值: 找到数组中的最大值,有两种方法,一种是apply,一种使用拓展运算符. 释义: 由于max()里面参数不能为数组,所以借助apply(funtion,args)方法调用Math. ...

  5. 复习C#的方法Math.Max和Math.Min

    温故而知新,今天学习Math.Max和Min的方法.这2个方法,均需要传入2个参数,返回参数中最大值和最小值. class Ac { public void LeanMathFunction() { ...

  6. Math.max.apply(null,arr)求最大值

    1.首先了解一下call和apply call 和 apply 的第一个参数是null/undefined时函数内的this指向window 或global call/apply 用来改变函数的执行上 ...

  7. Math.max得到数组中最大值

    Math.max(param1,param2) 因为参数不支持数组. 所以可以根据apply的特点来解决, var max = Math.max.apply(null,array),这样就可以轻易的得 ...

  8. 找出数字数组中最大的元素(使用Math.max函数)

    从汤姆大叔的博客里看到了6个基础题目:本篇是第1题 - 找出数字数组中最大的元素(使用Match.max函数) 从要求上来看,不能将数组sort.不能遍历.只能使用Math.max,所以只能从java ...

  9. Java控制语句例题,for循环语句,if条件语句等,Scanner类与Random类,Math.max()方法

    例题:编写程序,生成5个1至10之间的随机整数,并打印结果到控制台 import java.util.Random;class demo09 { public static void main(Str ...

随机推荐

  1. sublime text2小技巧

    1. 文件快速导航: 这是sublime上面很好用的功能之一,ctrl+p可以调出窗口,菜单上的解释是gotoanythings ,确实如其所言,调出窗口后,直接输入关键字,可以在已打开的项目文件夹中 ...

  2. Android开发实践:编译VLC-for-android

    最近在Android做流媒体相关的开发,一直想学习一下强大的VLC,正好趁此机会研究研究VLC-for-android的代码,看看优秀的开源音视频播放器是如何实现的.本文总结下在Linux平台下如何编 ...

  3. 移动web开发之屏幕三要素

    × 目录 [1]屏幕尺寸 [2]分辨率 [3]像素密度 前面的话 实际上,并没有人提过屏幕三要素这个词,仅是我关于移动web开发屏幕相关部分总结归纳的术语.屏幕三要素包括屏幕尺寸.屏幕分辨率和屏幕像素 ...

  4. javase基础复习攻略《五》

    总结完JAVA的基础语法和面向对象思想后,今天为大家补充一下JAVA中的数组,数组是什么呢?大家是不是想到了集合,数组和集合有相似之处,集合中的数据无序,不可以重复.数组中则存放着具有相同特征的一组数 ...

  5. Oracle Dataguard之物理standby的基本配置

    尽管网上有很多Oracle Dataguard的配置教程,但不难发现,很多采用的是rman duplicate这种方法,尽管此种方法较为简便.但在某种程度上,却也误导了初学者,虽说也能配置成功,但只知 ...

  6. JSON.stringify转换Date不正确的解決方法

    JSON.stringify转换Date不正确的原因:国际时区(UTC)和中国时区(GMT)的原因,东八区+8等于国际时区. 解决方法,重新Es5的Date.prototype.toJSON方法,代码 ...

  7. adb shell 查看系统属性(用来判断特殊的操作系统)

    一般来讲,在android程序开发中进行需要判断设备类型和系统版本 1.设备类型判断(android.os.Build.MODEL) 比如判断属于Google Nexus 5,Nexus 7,MIUI ...

  8. SQL分页查询,纯Top方式和row_number()解析函数的使用及区别

    听同事分享几种数据库的分页查询,自己感觉,还是需要整理一下MS SqlSever的分页查询的. Sql Sever 2005之前版本: select top 页大小 * from 表名 where i ...

  9. for循环的一种简化

    数组: var arr = [1, 2, 3, 5, 6]; 传统的教科书式的循环写法: for(var i=0; i<arr.length; i++){ console.log(arr[i]) ...

  10. Nancy 学习-身份认证(Basic Authentication) 继续跨平台

    开源 示例代码:https://github.com/linezero/NancyDemo 前面讲解Nancy的进阶部分,现在来学习Nancy 的身份认证. 本篇主要讲解Basic Authentic ...