jjzjj

domain_exists

全部标签

javascript - 内容脚本向后台发送响应时获取 "Could not establish connection. Receiving end does not exist."

我写了一个chrome扩展,popupjs会发消息给后台,后台会把消息重定向到contentscript,经过一些网络请求,结果应该返回给后台,然后popupjs。下面是我的一些简化代码。弹出js$('.porintButton').click(function(){switch(this.id){case'learningPointButton':chrome.runtime.sendMessage({action:'learning'},callback);processResult();break;}returntrue;});后台jschrome.runtime.onMessa

javascript - "Protocols, domains, and ports must match"问题

当我在控制台上查看时,我的网站有这些错误消息。谁能告诉我通常导致这些错误消息的问题是什么?Blockedaframewithorigin"mysite"fromaccessingaframewithorigin"facebook".Theframebeingaccessedset"document.domain"to"facebook",buttheframerequestingaccessdidnot.Bothmustset"document.domain"tothesamevaluetoallowaccess.contentscript_siteoverlay_bin.js:78B

javascript - Firebase,以 "a child exists"作为条件进行查询?

我有一个这样的数据库(附照片):行程有BIDS和awardedBid。我使用awardedBid!=null来确定行程是否仍可用于出价。但是,我不知道如何查询该条件,所以我必须通过创建另一个字段bidDone来破解,这样我就可以使用.equalTo,就像这样mRootReference.child(CHILD_TRIPS).child(mTripKey).orderByChild(BID_DONE).equalTo(true)但是,当我不得不使用2个键来表示一件事时,我觉得这是不安全的,因为它很容易出错(我确实在随附的屏幕截图中自己创建了一个,其中bidDone=false应该在哪里真

javascript - react 中的 "Cannot update during an existing state transition"错误

我正在尝试执行本ReactJS教程的第15步:React.jsIntroductionForPeopleWhoKnowJustEnoughjQueryToGetBy作者推荐如下:overflowAlert:function(){if(this.remainingCharacters()Oops!TooLong:);}else{return"";}},render(){...{this.overflowAlert()}...}我尝试执行以下操作(我觉得没问题)://initialized"warnText"inside"getInitialState"overflowAlert:func

解决launch:program .exe does not exist

二.程序的运行和调试1.launch.json复制下列代码至launch.json,并根据指导做出相对/绝对路径修改用IntelliSense了解相关属性。{//使用IntelliSense了解相关属性。//悬停以查看现有属性的描述。//欲了解更多信息,请访问:https://go.microsoft.com/fwlink/?linkid=830387"version":"0.2.0","configurations":[{"name":"gcc.exe-生成和调试活动文件","type":"cppdbg","request":"launch","program":"${workspaceFo

javascript - react : Can I check if a state exists before rendering it

我是React的新手,我制作了一个显示用户名user的导航栏{this.state.name}但问题是如果用户未登录,我会收到一个错误,因为this.state.name未定义。有什么方法可以在将它呈现为导航栏的一部分之前检查是否已定义this.state.name还是有更好的方法来消除此错误? 最佳答案 当然,使用三元:render(){return(this.state.name?{this.state.name}:null);}甚至更短render(){return(this.state.name&&{this.state.n

javascript - 为什么会出现这个错误 : "Invariant Violation: Cannot update during an existing state transition"

我似乎在一个大型应用程序中遇到了这个错误(但我不确定在哪里):UncaughtError:InvariantViolation:setState(...):Cannotupdateduringanexistingstatetransition(suchaswithinrender).Rendermethodsshouldbeapurefunctionofpropsandstate.我怀疑这可能是在setTimeout或setInterval中使用setState的结果。这引出了我真正的问题:为什么会存在这个错误?是否有一些概念上的原因我错过了为什么ReactJS不只是排队状态和Prop

javascript - 调试 : ng-click and non-existent functions

在解决问题之前,我有一个元素(在HTML模板内)带有ng-click,它调用了一个不存在的函数。有没有办法启用严格模式(比如在JS中使用严格模式)或类似的东西来在控制台中看到此类问题?更新:我也尝试过$compileProvider.debugInfoEnabled(true)但没有成功 最佳答案 简短回答:在原始AngularJS中没有执行此操作的选项,但是可以通过hack来完成。长答案:您在DOM事件处理指令中使用的表达式(例如ng-click、ng-keydown和ng-submit)由Angular的$parse编译。服务。

javascript - 谷歌浏览器插件 : How to get domain from URL (tab. 网址)

使用GoogleChromeAPI的tab.urlvalue,从整个值中获取域的最佳方法是什么?在JavaScript中,我会使用window.location.protocol和window.location.hostname。例如这样的事情:vardomain=window.location.protocol+"//"+window.location.hostname;但是那获取的是扩展域而不是选项卡,所以不能使用该方法。因此,使用类似于下面的函数...我如何从tab.url值中删除域?functionshow_alert(){chrome.tabs.getSelected(nul

javascript - 即使正确设置了 document.domain,跨子域 ajax 请求也被拒绝

在我的应用程序中,我在一个子域(dev.u413.com)上有一个网站,我使用jQuery向另一个子域(api.u413.com)上的JSONapi发出ajax请求。当我检查Chrome开发工具和FirefoxFirebug中的请求时,我的请求似乎被Access-Control-Allowed-Origin阻止了。我将document.domain设置为当前域的后缀:document.domain='u413.com';。这是我的要求:$.ajax({dataType:'json',data:{parseAsHtml:true,cli:'help'},url:'http://api.u