草庐IT

image_file

全部标签

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 - 为 svg :image 设置圆 Angular

我正在尝试使用d3.js为ssvg:image(嵌入在SVG中的图像)制作圆Angular。我找不到如何正确设置图像样式的方法,因为根据W3C规范,我应该能够使用CSS,但较窄的边框和圆Angular边缘对我来说都适用。提前致谢。vis.append("svg:image").attr("width",width/3).attr("height",height-10).attr("y",5).attr("x",5).attr("style","border:1pxsolidblack;border-radius:15px;").attr("xlink:href","http://www

javascript - 带返回值的 image.onload 函数

我有一个JS函数,其中计算了一个值并且应该返回该值,但我每次都得到undefined但是如果我console.log()结果在此它起作用的功能。你能帮忙吗?functiondetect(URL){varimage=newImage();image.src=URL;image.onload=function(){varresult=[{x:45,y:56}];//Anexampleresultreturnresult;//Doesn'twork}}alert(detect('image.png')); 最佳答案 值已返回,但不是来自d

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 - 有javascript机制修改Image的EXIF元数据信息吗?

关闭。这个问题不符合StackOverflowguidelines.它目前不接受答案。我们不允许提问寻求书籍、工具、软件库等的推荐。您可以编辑问题,以便用事实和引用来回答。关闭7年前。Improvethisquestion我正在寻找一种JavaScript机制来修改图像EXIF元数据信息,我发现有很多JS库允许我检索EXIF信息,但没有一个可以修改。我想修改图像的EXIF方向信息,然后保存它。

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 - 谷歌地图 API : Marker image positioning

我已经更改了我在Googlemap上用作标记的图像。新图像比旧图像宽得多,我注意到标记与lat和lng对齐,因此标记位于的水平中点code>lat和lng。这不是我想要的,我想让lat和lng与左侧的标记对齐-我想偏移marker从默认位置向右约80像素。 最佳答案 试穿这个尺寸。varmarkerImage=newgoogle.maps.MarkerImage('/img/icon/here.png',newgoogle.maps.Size(80,80),//sizenewgoogle.maps.Point(0,0),//orig