草庐IT

event-tracing-in-http-sys-part

全部标签

javascript - D3 数据映射 : OnClick Events on Bubbles

我正在关注数据map文档,我正在尝试为我在svg上呈现的气泡设置一个onClick监听器。现在,svgdiv具有以下子标签:....文档说对于map上列出的国家/地区,应该按以下方式完成:done:function(datamap){datamap.svg.selectAll('.datamaps-subunits').on('click',function(){alert("hello");});}这在尝试点击map上的特定区域时效果很好。尝试将相同的监听器附加到bubbles类没有任何效果..done:function(datamap){datamap.svg.selectAll(

javascript - Phaser JS 如何停止从 textButton.events.onInputDown 事件到 game.input.onDown 事件的事件传播(触发)?

这是JSFiddle.我这里有两个事件。game.input.onDown执行一些逻辑(在我的示例中生成粒子)是textButton.events.onInputDown,其中textButton是一个Phaser.Text对象实例,执行另一个逻辑。问题是:当我点击我的textButton时,这两个事件都被触发了1和2。问题是,当我点击textButton时,如何防止事件1触发?部分代码:...//Thiseventisfiredonclickanywhereevent#1game.input.onDown.add(particleBurst,this);//ThisisClickab

javascript - 文件结构 : Requiring Sub-Modules in Node. js

我有以下Node.js模块/npm包:|-dist/|--requirejs/|---[stuffinamdpattern...]|--node/|---index.js|---submodules/|----submodule1.js|----[submodule2.jsetc.]|-package.json|-README.md我可以通过模块名称要求dist/node/index.js(因为我将它设置为package.json中的主要入口点文件),如下所示:varmyModule=require('myModule');我想通过这样做来要求子模块(如在AMD模式中):varmySu

javascript - 强制 Protractor 的 onPrepare 等待异步 http 请求

我的Protractorconf.js,onPrepare函数需要发出一个http请求,如下所示,onPrepare:function(done){request.get('http://pepper/sysid').end(function(err,resp){if(err||!resp.ok){log("thereisanerror"+err.message)done()}else{global.sysid=resp.sysiddone()}})它抛出错误,done不是一个函数有没有其他方法可以在我的测试开始执行之前强制调用onPrepare中的回调?

javascript - 未捕获( promise )SyntaxError : Unexpected token ' in fetch function

我有几个结构如下的JSON文件(我们称之为info.json):{'data':{'title':'Job','company':'Company','past':['fulltime':['FormerCompany'],'intern':['Women&IT','Priority5']],'hobbies':['playingguitar','singingkaraoke','playingMinecraft',]}}在一个单独的JavaScript文件中,我有一个如下所示的函数:functiongetJSONInfo(){fetch('info.json').then(funct

javascript - 初学者的 : const definition in Redux confusing

在这个Redux入门类(class)中https://egghead.io/lessons/javascript-redux-store-methods-getstate-dispatch-and-subscribe?series=getting-started-with-redux,主持人说下面两行是一样的const{createStore}=Redux;varcreateStore=Redux.createStore;我刚刚搜索了ES6const文档,它并没有完全回答我的问题,这两行如何相同? 最佳答案 这与const(这只是定

javascript - 使用 event.target.id 从 bind(this) 获取 id 时意外使用 'event' no-restricted-globals

此代码适用于Codepen:参见https://codepen.io/pkshreeman/pen/YQNPKB?editors=0010然而,我试图在我自己的“create-react-app”中使用它,并且“no-restricted-globals”的错误是由event.target.id触发的。有什么解决方法。除了使用事件目标之外,您如何从“this”中获取id?constElem=(props)=>{return(GoodMorning!{props.name}{props.last}Thisisphasethree{props.text}SecondButton);};cl

javascript - Angular 4 Http POST 不工作

我希望每个人都做得很好。我最近开始使用angular4.4,我一直在尝试将数据发布到我的api服务器,但不幸的是它不起作用。我已经花了2天时间,但仍然没有成功。并且已经尝试了来自angular.io的6-7篇文章.我都试过了Http和Httpclient模块但似乎没有任何效果。问题是,每当我尝试将数据发布到我的服务器时,Angular都会生成httpOPTIONS类型请求而不是POST。this.http.post('http://myapiserver.com',{email:'adam@example.com'}).subscribe(res=>{constresponse=res

javascript - 通过 HTTP 回调函数进行谷歌地理编码?

我想使用google地理编码通过HTTP功能将城市名称转换为我的AJAX网络应用程序中的经度和纬度。但是,似乎不存在HTTP地理编码器功能的回调函数http://code.google.com/apis/maps/documentation/geocoding/index.html是真的,不存在回调函数吗?因为如果这是真的,那么它实质上意味着通过HTTPapi进行的Google地理编码在与AJAX一起使用时是无用的,因为JavaScript会抛出跨域异常错误。关于如何在JavaScript的AJAX网络应用程序中通过HTTPapi使用地理编码有什么想法吗?注意:我不想使用完整的Goog

javascript - 允许 HTTP iFrame 在 HTTPS 父框架上调用 JavaScript

我有一个https页面(https://example.com/main.php),它有一个带有非https源(http://example.com/inner.php)的iframe。两个文件都在同一台服务器上——只有一个可以通过https访问,另一个不能。我需要非https页面能够使用parent.myfunction()等代码在httpsmain.php页面上执行javascript但是,当我尝试这样做时,出现以下错误:UnsafeJavaScriptattempttoaccessframewithURLhttps://example.com/main.phpfromframew