<script type="text/javascript"> function changeURL(){ var url = document.getElementById('url').value; window.history.pushState({},0,'http://'+window.l ...
分类:
Web程序 时间:
2016-09-19 13:00:45
阅读次数:
249
在前端开发中,经常需要定义JS类。那么在JavaScript中,定义类的方式有几种,分别是什么呢?本文就JS定义类的六中方式说明如下(案例说明):1、工厂方式 function Car(){ var ocar = new Object; ocar.color = "blue"; ocar.doors ...
分类:
Web程序 时间:
2016-09-19 11:32:51
阅读次数:
208
function creatperson(name,sex){ var obj=new Object; obj.name=name; obj.sex=sex; obj.showname=function(){ alert(this.name); }; obj.showsex=function(){ ...
分类:
Web程序 时间:
2016-09-19 11:24:48
阅读次数:
185
题目: Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the ...
分类:
其他好文 时间:
2016-09-19 06:45:52
阅读次数:
157
Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The function ...
分类:
其他好文 时间:
2016-09-19 06:38:25
阅读次数:
89
redux使用 1 <script type="text/babel"> 2 var Counter=React.createClass({ 3 4 incrementIfOdd:function(){ 5 if (this.props.value % 2 !== 0) { 6 this.props ...
分类:
其他好文 时间:
2016-09-19 01:16:31
阅读次数:
236
一、过渡: transition 简写属性,用于在一个属性中设置四个过渡属性。 transition-property 规定应用过渡的 CSS 属性的名称。 transition-duration 定义过渡效果花费的时间。默认是 0。 transition-timing-function 规定过渡效 ...
分类:
Web程序 时间:
2016-09-19 01:13:06
阅读次数:
207
函数表达式,什么概念,表达式中的函数表达式。 1 函数申明 function 函数名([函数参数]){ //函数体 } js中无论像这样的显示函数什么放在调用之前还是调用之后,都不影响使用,因为js解释引擎会将函数声明提前化,这点很好理解; 2 函数表达式 var functionV=functio ...
分类:
Web程序 时间:
2016-09-19 01:07:39
阅读次数:
150
创建字符串<li></li>$.function(){var str =} merge;用法 对外组数何必 对内部 还可以json合并var arr = ["a","b","c"];var arr2 = ["d"];congse.log($.merge(arr,arr2)) 适合创建单标签$("<> ...
分类:
其他好文 时间:
2016-09-19 01:06:12
阅读次数:
111
Write a function to find the longest common prefix string amongst an array of strings. 让我们在一个字符串中找出所有字符串的共同前缀 ...
分类:
其他好文 时间:
2016-09-19 01:03:18
阅读次数:
171