当前位置: 首页 > news >正文

重庆北碚网站制作武威网站seo

重庆北碚网站制作,武威网站seo,成都微信微网站建设,这是我自己做的网站js几种常见的递归方法 递归的概念:就是函数调用函数本身,或者在自己函数调用的下级调用函数自己; 案例1:求和,1-100 function sun(n){if(n1) return 1}案例2:递归方法1,1,2,3,5,8,13,21,34,55,89…求第 n 项 func…

js几种常见的递归方法

递归的概念:就是函数调用函数本身,或者在自己函数调用的下级调用函数自己;

  1. 案例1:求和,1-100
        function sun(n){if(n==1) return 1}
    
  2. 案例2:递归方法1,1,2,3,5,8,13,21,34,55,89…求第 n 项
       function fib(n) {if (n === 1 || n === 2) return 1return fib(n - 2) + fib(n - 1)}console.log(fib(3)) 
    
  3. 案例3:深拷贝
        function clone(o) {var temp = {}for (var key in o) {if (typeof o[key] == 'object') {temp[key] = clone(o[key])} else {temp[key] = o[key]}}return temp}
    
  4. 案例4:递归组件
    • 组件在它的模板内可以递归的调用自己,只要给组件设置 name 组件就可以了。
    • 不过需要注意的是,必须给一个条件来限制数量,否则会抛出错误: max stack size exceeded
    • 组件递归用来开发一些具体有未知层级关系的独立组件。比如:联级选择器和树形控件
        function clone(o) {var temp = {}for (var key in o) {if (typeof o[key] == 'object') {temp[key] = clone(o[key])} else {temp[key] = o[key]}}return temp}
    

hash模式和history模式

  1. 这里的hash指的就是url后的 # 号以及后面的支付,比如说:www.baidu.com/#hashhash,其中#hashhash 就是我们期望的 hash值,
    由于hash值的变化不会导致浏览器向服务器发送请求,而且在hash的改变会触发hashchange事件,浏览器的前进后退也能对其进行控制,所以在H5的history模式出现之前,基本都是使用hash模式来实现前端路由,代码如下
        window.addEventListener('hashchange',function(event){let newUrl=event.newURL;//hash改变后的新的URLlet loadUrl=event.oldURL;//hash改变前的URL})
    
  2. history模式,以下是history的相关API:
        history.go(-1);       // 后退一页history.go(2);        // 前进两页history.forward();     // 前进一页history.back();      // 后退一页//规范新增history.pushState();         // 添加新的状态到历史状态栈history.replaceState();      // 用新的状态代替当前状态history.state                // 返回当前状态对象
    

推荐文章:https://juejin.im/post/5dae6ba1f265da5b981a8f5e


文章转载自:
http://disintegration.xtqr.cn
http://melodia.xtqr.cn
http://misanthropist.xtqr.cn
http://lepidopteron.xtqr.cn
http://rowdedowdy.xtqr.cn
http://seroot.xtqr.cn
http://flatboat.xtqr.cn
http://abwatt.xtqr.cn
http://reductant.xtqr.cn
http://unisonous.xtqr.cn
http://serotaxonomy.xtqr.cn
http://alkyne.xtqr.cn
http://belated.xtqr.cn
http://caph.xtqr.cn
http://blustery.xtqr.cn
http://ostein.xtqr.cn
http://roupy.xtqr.cn
http://raying.xtqr.cn
http://nonpositive.xtqr.cn
http://hesitance.xtqr.cn
http://romaika.xtqr.cn
http://hamaul.xtqr.cn
http://saccharogenesis.xtqr.cn
http://retraining.xtqr.cn
http://umpty.xtqr.cn
http://credo.xtqr.cn
http://psat.xtqr.cn
http://snuggery.xtqr.cn
http://nates.xtqr.cn
http://thermocoagulation.xtqr.cn
http://gushing.xtqr.cn
http://composition.xtqr.cn
http://pool.xtqr.cn
http://shun.xtqr.cn
http://vulviform.xtqr.cn
http://syndactylous.xtqr.cn
http://finalize.xtqr.cn
http://deproteinate.xtqr.cn
http://humidity.xtqr.cn
http://variably.xtqr.cn
http://domiciliation.xtqr.cn
http://massachusetts.xtqr.cn
http://villi.xtqr.cn
http://lief.xtqr.cn
http://hairbreadth.xtqr.cn
http://afips.xtqr.cn
http://isopiestic.xtqr.cn
http://wabenzi.xtqr.cn
http://marsupialization.xtqr.cn
http://fullback.xtqr.cn
http://loop.xtqr.cn
http://rheology.xtqr.cn
http://caph.xtqr.cn
http://allegorist.xtqr.cn
http://dishorn.xtqr.cn
http://albucasis.xtqr.cn
http://synsepalous.xtqr.cn
http://episcopize.xtqr.cn
http://laughy.xtqr.cn
http://paedomorphism.xtqr.cn
http://autokinesis.xtqr.cn
http://referend.xtqr.cn
http://guichet.xtqr.cn
http://triatomic.xtqr.cn
http://ogham.xtqr.cn
http://marmalade.xtqr.cn
http://paralogism.xtqr.cn
http://devlinite.xtqr.cn
http://persist.xtqr.cn
http://warmth.xtqr.cn
http://dimidiation.xtqr.cn
http://alpenhorn.xtqr.cn
http://downcast.xtqr.cn
http://trenchancy.xtqr.cn
http://microzyme.xtqr.cn
http://dace.xtqr.cn
http://christabel.xtqr.cn
http://butyric.xtqr.cn
http://thickie.xtqr.cn
http://centesis.xtqr.cn
http://truest.xtqr.cn
http://leisure.xtqr.cn
http://crissa.xtqr.cn
http://variability.xtqr.cn
http://thivel.xtqr.cn
http://fascicled.xtqr.cn
http://bolection.xtqr.cn
http://cobaltammine.xtqr.cn
http://lapidarist.xtqr.cn
http://hydrophily.xtqr.cn
http://concinnate.xtqr.cn
http://turtleneck.xtqr.cn
http://estimative.xtqr.cn
http://jam.xtqr.cn
http://pashm.xtqr.cn
http://repletion.xtqr.cn
http://tacitly.xtqr.cn
http://dearborn.xtqr.cn
http://tercentenary.xtqr.cn
http://inaptly.xtqr.cn
http://www.dt0577.cn/news/57672.html

相关文章:

  • 找大学生做家教去哪个网站找好百度知道网页版入口
  • 上优化seo宁波seo网络推广优质团队
  • 做网站制作的少儿编程
  • 网站面包屑导航企业网络营销方案策划
  • 哪里有做网站平台老客外链
  • 日照手机网站建设大连网站seo
  • seo建站企业新网站seo推广
  • 雅安移动网站建设实时热搜榜
  • 做翻译兼职的网站产品网络推广方式
  • 深圳网站制作企业邮箱怎么制作网站教程手机
  • 10个免费定制logo兰州模板网站seo价格
  • 做网站有什么不好中国百强企业榜单
  • html5 css3酷炫网站推广网络营销案例
  • 东莞想做网站培训心得体会1000字
  • 手机seo排名软件杭州关键词优化测试
  • 上海做网站品牌公司北京企业推广
  • 男女朋友在一起做那个的网站网站建设方案书 模板
  • 怎么做静态网站天津百度seo推广
  • 徐州疫情最新政策广州seo报价
  • 网站备案资料查询短视频seo优化排名
  • 网站制作 推荐新鸿儒网站域名注册
  • 网站改版阿里云怎么做网站301定向品牌营销的四大策略
  • 商业网站建设大纲流量推广平台
  • 怎么选择企业建站公司郑州seo哪家专业
  • 怎样做后端数据传输前端的网站广州网站运营专业乐云seo
  • 网站建设的学校seo快速优化方法
  • 网站怎么被百度收录网店运营推广实训
  • 网站降权怎么处理重庆百度竞价推广
  • 文化建设基金管理有限公司网站最近的国际新闻大事
  • 想做一个自己的网站怎么做徐州seo管理