![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
javaScript
文章平均质量分 50
ZY_Ru
学生
展开
-
【leetcode 9】javascript Palindrome Number回文数
【题目描述】Determine whether an integer is a palindrome. Do this without extra space.方法一:/** * @param {number} x * @return {boolean} */var isPalindrome = function(x) { if(x<0){return false;}原创 2018-01-23 09:10:28 · 277 阅读 · 0 评论 -
git clone提示失败 fatal: The remote end hung up unexpectedlReceiviny00 KiB/s fatal: early EOF(328/529),
git clone提示:fatal: The remote end hung up unexpectedlReceiviny00 KiB/sfatal: early EOF(328/529), 13.43 MiB | 29.00 KiB/sfatal: index-pack failed解决方法:运行:git config –global http.postBuffer 1048576000 即可...原创 2018-03-22 10:34:22 · 13811 阅读 · 0 评论 -
jQuery类库——getter和setter
获取和设置HTML属性attr()方法是jQuery中用于HTML属性的getter/setter,removeAttr()从所有选中元素中移除某个属性。获取和设置CSS属性css()方法作用于元素的CSS样式,不能获取复合样式。获取样式时,把数值转换成带有单位后缀的字符串返回。设置样式时,将数值转换成字符串,必要时添加“px"后缀。获取和设置CSS类addClass()和removeClass(...原创 2018-03-02 14:23:09 · 271 阅读 · 0 评论 -
jQuery类库——基础
使用JavaScript框架或工具类库,能简化通用操作,隐藏浏览器之间的差异。jQuery足够小巧和稳定,能让你在文档中轻松找到关心的元素,并对这些元素进行操作。jQuery()函数有4中不同的调用方式:传递CSS选择器(字符串)给$()方法。传递一个Element、Document或Window对象给$()方法,$()只需简单的将该对象封装成jQuery对象并返回。这样就可以使用jQuery方法...原创 2018-03-02 11:23:21 · 1108 阅读 · 0 评论 -
JavaScript类型转换
JavaScript类型转换值转换为字符串数字布尔值对象undefined"undefined"NaNfalsethrows TypeErrornull"null"0falsethrows TypeErrortrue"true"1new Boolean(true)false"false"0new Boolean(false)""(空字符串)0falsenew String("")"原创 2018-03-01 21:54:29 · 153 阅读 · 0 评论 -
JavaScript闭包
函数对象可以通过作用域链相互关联起来,函数体内部的变量都可以保存在函数作用域内。这种特性称为“闭包”。函数定义时的作用域链到函数执行时依然有效。var uniqueInteger=(function(){ var counter=0; return function(){return counter++;};//返...原创 2018-03-01 17:12:25 · 162 阅读 · 0 评论 -
JavaScript变量作用域
和大多数现代编程语言一样,JavaScript采用词法作用域。函数的执行依赖于变量作用域,这个作用域是在函数定义时决定的,而不是在函数调用时决定的。变量作用域:程序源代码中定义这个变量的区域。全局变量用于全局作用域,在JavaScript代码中的任何地方都是有定义的。在函数内声明的变量只在函数体内有定义。函数参数也是局部变量,只在函数体内有定义。在函数体内,局部变量的优先级高于同名的全局变量。Ja...转载 2018-03-01 15:23:19 · 137 阅读 · 0 评论 -
JavaScript函数的属性和方法
ECMAScript中的函数是对象,因此函数也有属性和方法。每个函数都有两个属性:length和prototype。length属性表示函数希望接收的命名参数的个数。每个函数都包含两个非继承而来的方法:apply()和call(),用途都是在特定的作用域中调用函数,实际上等于设置函数体内this对象的值。apply()方法接收两个参数:一个是在其中运行函数的作用域,另一个是参数数组。第二个可以是A...转载 2018-03-06 20:58:04 · 1149 阅读 · 0 评论 -
【前端】HTML5 利用canvas绘制柱状图
参考链接:https://www.cnblogs.com/linxin/p/6892389.html参考书籍:《HTML5权威指南》canvas元素所有功能体现在一个JavaScript对象上,该元素本身只有两个属性:height、width。var cxt=document.getElementById("myCanvas").getContext("2d");//getCon转载 2018-01-23 14:08:44 · 7370 阅读 · 0 评论 -
【前端】描述cookies,sessionStorage和localStorage的区别
汇总一下网络上的说法链接:https://www.nowcoder.com/questionTerminal/e104d1a0512a42b5b8c61e43a4bc3d34 http://www.w3school.com.cn/html5/html_5_webstorage.aspcookie是小甜饼的意思。顾名思义,cookie确实非常小,它的大小限制转载 2018-01-23 13:14:22 · 1782 阅读 · 0 评论 -
【前端】优雅降级与渐进增强的区别
优雅降级:graceful degradation 一开始就构建完整的功能,然后针对低版本浏览器进行兼容。渐进增强:progressive enhancement 针对低版本浏览器进行构建页面,保证最基本的功能,然后针对高级浏览器进行效果、交互等改进和追加功能以达到更好的用户体验。目的都是关注不同浏览器下的不同体验,但是它们的侧重点不同,导致工作流程的不同。优雅降级观点认为应该针对那些转载 2018-01-23 10:50:43 · 1071 阅读 · 0 评论 -
【leetcode 122】javascript Best Time to Buy and Sell Stock II
【题目描述】Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete as many transactions as you like (ie原创 2018-01-23 09:28:35 · 380 阅读 · 0 评论 -
【leetcode 21】javascript Merge Two Sorted Lists
【题目描述】Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists./** * Definition for singly-linked list. * func原创 2018-01-23 09:26:09 · 707 阅读 · 0 评论 -
【leetcode 15】javascript 3Sum
【题目描述】Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note: The solution set must n原创 2018-01-23 09:22:03 · 204 阅读 · 0 评论 -
git fatal: Not a git repository (or any of the parent directories): .git
报错:fatal: Not a git repository (or any of the parent directories): .git运行 git init 即可原创 2018-03-22 10:47:43 · 551 阅读 · 0 评论