草庐IT

send_static_file

全部标签

javascript : sending custom parameters with window. open() 但它不工作

functionopen_win(){window.open("http://localhost:8080/login","mywindow")}你好,单击按钮,我将打开一个新网站(我的网站)我有两个文本字段(一个文本字段和另一个密码字段),我试图将这些值发送到另一个打开的窗口。但它并没有像我想要的那样工作。我试过以下方法1.window.open("http://localhost:8080/login?cid='username'&pwd='password'","mywindow")2.window.open("http://localhost:8080/login","mywi

javascript - rails 4 : How to add external javascript file from other site in a specific page

我正在使用turbolink(rails4)并且以下js链接由我的页面标题部分中的application.js文件生成我的application.js看起来像这样://=requirejquery//=requirejquery_ujs//=requireturbolinks//=require_tree.//=requirebootstrap.min.js//=requirerespond.min.js我想从其他站点添加一个外部javascript文件,例如http://otherdomain.com/xyz.js在我网站的特定页面中。假设我只想在特定页面中添加这个外部js文件htt

javascript - 火力地堡存储 : "Invalid argument in put at index 0: Expected Blob or File

我不断收到Invalidargumentinputatindex0:ExpectedBloborFile错误。有趣的是参数完全是一个文件...代码如下:varfile=document.getElementById('cke_69_fileInput').contentWindow.document.getElementById('cke_69_fileInput_input').files[0];varstorageUrl='noticias/imagenes/';varstorageRef=firebase.storage().ref(storageUrl+file.name);c

javascript - Angular 4 : How to read content of text file with HTTPClient

我的Angular4项目目录中有一个.txt文件,我想阅读它的内容。怎么做?下面是我使用的代码。该文件位于“app”文件夹内的“files”文件夹中。我拥有HTTPClient代码的组件位于“app”文件夹内的“httpclient”文件夹中。意思是“files”文件夹和“httpclient”文件夹是子文件夹。代码如下所示。它不工作,因为我收到404错误-'GEThttp://localhost:4200/files/1.txt404(未找到)'this.http.get('/files/1.txt').subscribe(data=>{console.log(data);},(er

javascript - react 和 Jest : Cannot find module from test file

为目录中的Redux操作('App.js')设置Jest测试('App-test.js')app/__tests__:这是App.js的header:jest.unmock('../../modules/actions/App.js')importReactfrom'react'importReactDOMfrom'react-dom'importTestUtilsfrom'react-addons-test-utils'import*asAppfrom'../../modules/actions/App.js'在app/有一个模块config.js.这是在需要的地方导入的。问题是,当

javascript - Firefox 扩展 : Error calling executeScript on file but not code

我正在尝试在新选项卡打开时在该选项卡中执行脚本。在我的后台脚本中我有:varlistener=function(tab){browser.tabs.executeScript(null,{file:"content_scripts/contentScript.js"});}browser.tabs.onCreated.addListener(listener);在contentScript.js中:functionfoo(){console.log("Executed");}foo();由此我得到以下错误:Error:Permissiondeniedtoaccessproperty"c

javascript - 为什么 'file.size'需要很多时间,如何减少时间?

我正在制作一个处理被拖到应用程序中的歌曲的应用程序。当我使用file.size获取文件大小时,获取该值大约需要1500毫秒(平均)。有没有更快的方法?我理解为什么这需要时间(和内存),但由于我是处理HTML5文件的新手,也许有一些我不知道的东西可以使这个过程更快。文件系统API也是如此。如果我通过它调用文件并调用file.size,则需要类似的时间。PS我是通过在我的代码中添加console.time()得出这个结论的。这是代码(大量精简)fileSystem.root.getFile(id,{},function(fileEntry){fileEntry.file(function(

javascript - polymer 1.0 : Multiple calls to send() method of iron-request

我有一个使用实例的组件从后端检索数据,我想使用发送更新,例如POST/DELETE请求。第一次一切都完美无缺。但是,如果再次调用请求,则会出现错误:UncaughtTypeError:Cannotreadproperty'then'ofundefined我的模板定义如下所示:......在我的组件脚本中,我使用了send()的方法|发送POST:varme=this;this.$.xhr.send({url:"/cart-api",method:"POST",body:JSON.stringify(entry)}).then(function(){me._refresh();},fun

javascript - 玩! 2.4 : How to allow CORS from origin file://

我正在使用play2.4制作公共(public)RESTAPI。我添加了允许所有来源和header的CORS过滤器。从application.conf中查看:play.filters{#CORSfilterconfigurationcors{#Thepathprefixestofilter.pathPrefixes=["/"]#Theallowedorigins.Ifnull,alloriginsareallowed.allowedOrigins=null#TheallowedHTTPmethods.Ifnull,allmethodsareallowedallowedHttpMetho

javascript - 如何使用 nervgh 的 Angular-File-Upload 发送 formData

我正在使用nervgh的Angular-File-Uploadhttps://github.com/nervgh/angular-file-upload当我对preOpKey进行硬编码时,它的工作就像一个魅力。我想要做的是将preOpKey与文件一起发送,以便我可以将文件保存到数据库中的适当记录中。angular-file-upload在我在$scope.OnPreinspectionSubmit()中填充的API中有一个fileData但由于某种原因我找不到它在我的MVCController中调用一次SaveFile()的值。我只需要知道如何将一个值与我的文件一起传递,然后在我的MV