草庐IT

READ_HISTORY_BOOKMARKS

全部标签

javascript - react 路由器 : access history in rendered Route component

我知道有很多关于此的问题,但我似乎无法让它工作:我需要从通过路由呈现的子组件访问“历史记录”。(它从redux容器接收Prop)。我需要将历史对象传递给在每个路由中呈现的组件,这样我就可以this.props.history.push('/route')在子组件中。这个应用程序以前不太动态,所以每个Route都用component={someComponent}硬编码;但我发现在动态执行路由时,您需要使用render={()=>}.从component={}更改路线后至render={()=>...}我在子组件中丢失了历史记录。我的代码是这样的:importReact,{Compone

javascript - 为什么 "chrome.bookmarks.getTree"不起作用?

如果我尝试下面的代码:chrome.bookmarks.getTree(function(items){items.forEach(function(item){document.write(item.url);});});它返回未定义的。但是当我写的时候:chrome.bookmarks.getRecent(20,function(items){items.forEach(function(item){document.write(item.url);});});有效。为什么不同? 最佳答案 chrome.bookmarks.ge

javascript - jQuery 用户界面 : Uncaught TypeError: Cannot read property 'display' of undefined

我正在尝试使用jqueryajax获取数据,一切正常,我得到了我想要的,但我无法显示它,因为我收到未捕获的类型错误:无法读取未定义的属性“显示”。这里是代码。有什么想法吗?/**Getthedatafromtheajaxcallanddisplayadialog*/functionCreateDialog(email){//getthedatafromtheajaxcallvarpromise=AjaxSubscribe(email)//ifdataareavailable,showthedialogpromise.success(function(data){//dataisasim

javascript - 结合 window.history.pushState 返回历史记录时,页面不会重新加载

当我使用window.history.pushState更改url时,返回浏览器历史记录时页面不会自动重新加载,例如通过点击“历史后退按钮”。为什么页面没有自动重新加载?我可以改变这种行为吗?这里有一小段代码来举例说明这个“问题”:Locationtestfunctionload(){varvalue=window.location.search.substr(1);document.getElementById('myInput').value=value;document.title='Locationtest-'+value;}functionset(el){window.his

javascript - 强制定向图错误, "Cannot Read Property ' Push' of Undefined"

我是编码新手,最近开始使用d3生成力导向图。使用链接派生节点时,我成功生成了一个四节点图。但是,当我明确列出节点时,我收到错误“UncaughtTypeError:Cannotreadproperty'push'ofundefined(d3.v3.min.js)”。我研究了对以下两个类似问题的回答,但无法使用答案解决此问题。我试图尽可能多地删除不相关的功能,谢谢。JavaScripterror"UncaughtTypeError:Cannotcallmethod'push'ofundefined"D3.jsUncaughtTypeError:Cannotcallmethod'push'

javascript - redux saga 和 history.push

背景:我正在创建一个Login组件。saga.js由3个函数组成1.rootSaga。它将执行sagas里面的列表2.watchSubmitBtn。它会观察提交按钮的点击并发送一个Action。3.shootApiTokenAuth会接收派发的action并处理axios.post返回值为promise对象在行动:后端返回400给React。这种情况没问题,我可以轻松读取payload并在render()中显示。但是当返回200时。我需要让用户转到url/companies。尝试:我曾尝试将this.props.history.push('/companies');放在componen

javascript - 未捕获的类型错误 : Cannot read property 'name' of undefined

单击“选择文件”时,我有以下代码:$(':file').change(function(){if(this.files.length==1){$('#selected_files').html("Attaching"+this.files.length+"file");}else{$('#selected_files').html("Attaching"+this.files.length+"files");}$('#selected_files').append("FilenameSize");for(x=0;x"+name+"("+filesize(size)+")"+type+"

javascript - CKEditor 4 : Uncaught TypeError: Cannot read property 'langEntries' of null

我正在为CK编辑器(https://github.com/galetahub/ckeditor)使用Rubygem,但出现此错误:UncaughtTypeError:Cannotreadproperty'langEntries'ofnull这是它在代码中出现的地方:CKEDITOR.plugins.load=CKEDITOR.tools.override(CKEDITOR.plugins.load,function(a){vard={};returnfunction(b,c,e){vari={},g=function(b){a.call(this,b,function(a){CKEDI

javascript - 未捕获的类型错误 : Cannot read property 'getContext' of null

在我的控制台中,我收到错误:“未捕获的类型错误:无法读取null的属性‘getContext’”我就是找不到我犯的错误……或者我做错了什么。那么也许你可以帮我找到它?请帮助:)entercodeherevarcanvas=document.getElementById("myCanvas");varctx=canvas.getContext("2d");varcW=canvas.width=1000;varcH=canvas.height=500;varparticleAmount=10;varparticles=[];for(vari=0;i 最佳答案

javascript - 在 jquery ajax 上使用 history.pushstate

我有一个非常基于ajax的应用程序,其中我只有一个登录页面和主页。我的大部分链接都是“ajaxed”的,我是这样完成的://getthehrefofthelinkthathasbeenclicked,ajaxifyANYlinks$(document).on('click','.treea',function(){varlink=$(this).attr('href');//getthehrefoffthelist$.ajax({//ajaxrequesttopostthepartialViewurl:link,type:'POST',cache:false,success:funct