草庐IT

value_at_location

全部标签

javascript - react native v0.56 : Cannot read property 'filename' of undefined at PluginPass. JSXOpeningElement

我刚刚将ReactNative从0.55更新到0.56。但是,当我尝试运行代码(react-nativerun-android或run-ios)时,捆绑停止到这一点:Loadingdependencygraph,done.error:bundlingfailed:TypeError:Cannotreadproperty'filename'ofundefinedatPluginPass.JSXOpeningElement({path_to_my_project}/react-native/node_modules/babel-plugin-transform-react-jsx-sour

Javascript 对象文字 : value initialization?

我使用对象字面量来创建带有方法的对象。这里有一个简单的例子。varSizeManager={width:800,height:600,ratio:this.width/this.height,resize:function(newWidth){width=newWidth;height=newWidth/ratio;}}我的问题是SizeManager.ratio返回“NaN”。我很确定这是一个初始化问题。有没有办法获得正确的比率值?有没有办法将构造函数或初始化程序分配给对象字面量?定义构造函数对象是唯一的方法吗?编辑:当然SizeManager理想情况下是一个单例(只有一个对象),这

javascript - 使用 window.location.href 或 .assign 或 .reload 时等待时间很长

我在ajax调用后(更新内容后)使用JavaScript重定向。我试过下面的方法,都很慢。在网络选项卡中,它显示等待时间约为4.44到5秒。(这让客户非常沮丧:()window.location.assign(to_redirect);window.location.replace(to_redirect);location.href=to_redirect;window.location.href=to_redirect;window.location=to_redirect;从一个页面浏览到另一个页面(点击鼠标)时,等待时间为350毫秒到450毫秒。为什么会这样?有什么我错过的或任

javascript - window.location 重定向有效,但原始 URL 未显示在浏览器历史记录中

下面的代码运行良好。这是我的问题:窗口url重定向,但原始url未记录在我的浏览器历史记录中。例如,如果我访问“http://example.com/page1”,浏览器会重定向到“http://example.com/test”,这是应该的。但是,我需要访问过的原始url(“http://example.com/page1”)显示在我的浏览器历史记录中,以便我可以在不同的函数中调用它。有没有办法在重定向之前获取访问的原始url以登录我的浏览器历史记录?$(document).ready(function(){if(window.location=="http://example.co

javascript - 为什么 location.reload() 比其他页面重新加载方法慢?

几个月前我发布了thisanswer关于如何通过JavaScript刷新页面。我提供了一个JSFIDDLEDEMO也是:varsolutions=[function(){location.reload();},function(){history.go(0);},function(){location.href=location.href;},function(){location.href=location.pathname;},function(){location.replace(location.pathname);},function(){location.reload(fa

javascript - Angular 2 : How to use css calc() with some component value?

我想使用calcCSS函数根据组件值计算div高度。它给我的错误:TypeError:co.calcisnotafunction我的代码: 最佳答案 您的语法不正确。正确的方法是: 关于javascript-Angular2:Howtousecsscalc()withsomecomponentvalue?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/45456674/

javascript - Google API,从数据表中获取值(value)

google.visualization.events.addListener(geomap,"regionClick",function(e){console.log(e["region"]);console.log(data.getValue(e["region"],1));});我使用此代码查看单击了哪个区域。e["region"]给出该区域的行号,然后我使用getValue查看区域(标记)名称。现在,在控制台日志中显示了这个错误:未捕获错误:行索引1无效。应该在[0-14]范围内行索引1如何无效,因为它在[0-14]范围内?编辑:好了,更多代码:)GoogleVisualiza

javascript - ECMAScript(ECMA-262 5.1)中的 `base value` 的 `reference` 是什么?

我一直在尝试理解this值是如何在javascript中设置的,并且发现ECMAScript语言规范非常有用。我在读section8.7referencespecificationtype发现ECMAScript中的引用由3个部分组成,basevalue,referencedname,strictreferenceflag了解section11.2.3.我可以根据他们的名字假设什么是referencedname和strictreferenceflag,但我不明白什么是basevalue.文件说basevalue是undefined,String,Boolean,Number和Objec

javascript - 高库存,错误 : Uncaught TypeError: w[(intermediate value)(intermediate value)(intermediate value)] is not a constructor

我正在尝试创建highstock图表,但出现以下错误:error:UncaughtTypeError:w[(intermediatevalue)(intermediatevalue)(intermediatevalue)]isnotaconstructor我的JSON似乎有效,我的javascript也有效,知道如何解决这个问题吗?Javascript:$.getJSON('analytic/weekly_views_json',function(data){//Createthechart$('#container2').highcharts('StockChart',{rangeS

javascript - 如何防止 window.location.pathname 转义 URL 中的字符

我正在开发一个谷歌应用引擎应用程序。单击按钮时,我试图将用户重定向到登录页面。为此,我将window.location.pathname设置为以下字符串/_ah/login?continue=http%3A//localhost%3A8080/。但是,chrome对该字符串进行了转义,以便完整的URL变为http://localhost:8080/_ah/login%3Fcontinue=http%3A//localhost%3A8080/,这会产生404错误。我怎样才能防止这种情况发生?有效的URL是http://localhost:8080/_ah/login?continue=h