草庐IT

the-iframe-element

全部标签

javascript - Greybox : Can't move focus to the control because it is invisible, 未启用,或者是不接受焦点的类型

这个问题在这里已经有了答案:关闭10年前。PossibleDuplicate:JavaScript:VisibilityerrorinInternetExplorerwhensettingfocusonaninputelement我有一个在灰框中加载的页面。我使用document.getElementById("textfield").focus()设置焦点-这在直接调用页面时效果很好。但是当在灰盒中加载时,将焦点设置在onload()事件上会返回:Can'tmovefocustothecontrolbecauseitisinvisible,notenabled,orofatypeth

JavaScript replace() 方法 : remove empty space just at the end and at the beginning of the string

这个问题在这里已经有了答案:关闭10年前。PossibleDuplicate:HowdoItrimastringinjavascript?通过在javascript中使用replace方法,我试图删除字符串开头和结尾之间的空白区域:这是我的代码:知道我应该如何获得结果吗?input->"firstsecond".replace(/[^\s|\s$]/g,'');//""output->"firstsecond"

javascript - 禁用 DFP/DoubleClick iFrame

在GoogleDFP(DoubleClick)中,系统会为您提供一个广告代码以放入页眉,另一个用于您的正文。当我将这个给定的广告标签/代码应用到我的网站时,无论是异步还是同步,广告总是显示在iframe中。我想知道如何禁用iFrame。这是通过DFP生成的header代码:vargoogletag=googletag||{};googletag.cmd=googletag.cmd||[];(function(){vargads=document.createElement('script');gads.async=true;gads.type='text/javascript';var

javascript - Youtube iFrame(使用 javascript API)第一次加载,但第二次不加载。为什么?

我正在使用带有以下代码的iFrameYoutubeAPI。我使用Ajax调用此View以呈现它并将其附加到我页面中的div.yt-player中。它在我第一次调用View时有效,但在我关闭视频(清空div.yt-player)并单击另一个调用我的View的链接后,视频根本无法加载(空白)。我一直在努力,但仍然不明白为什么会这样,尤其是它第一次起作用。非常感谢任何形式的帮助。谢谢。PS:html和javascript都是由View渲染的。HtmlJavascript:vartag=document.createElement('script');tag.src="https://www.

javascript - 使用基于 iframe 的 View 很难访问 Dynamics 2013 访问页面实体

我正在构建一个在Dynamics2013上作为Web资源运行的Angular应用程序。应用程序使用一个按钮运行,该按钮使用Ribbon工作台添加到commandContainer,然后该按钮调用Xrm.Internal.openDialog在我想开始使用由Xrm.Page.Data公开的实体之前,所有这些工作正常基本上我的按钮在动态主页的上下文中运行,但是实体位于iframe中,它基于我所在的页面具有不同的ID和名称。所以使用一个简单的选择器我无法获取它的contentWindow并开始使用实体。从#contentIFrame0到#contentIFrame(n),#crmConten

javascript - Express.js 和 multer : how to know when the files are all uploaded?

我正在使用Multer模块进行文件上传。虽然一切正常,但在他们的github页面末尾有一条警告,内容如下:“警告:req.body在文件上传完成后被完全解析。过早地访问req.body可能会导致错误。”这让我非常担心。我只是找不到让.post中间件知道文件何时上传并且req.body可以使用的方法。这是我的代码:应用程序.js:app.use(multer({dest:'./uploads/',rename:function(fieldname,filename){returnfilename.replace(/\W+/g,'-').toLowerCase()+Date.now();}

javascript - 猎犬.js : Transform the data returned by a remote source?

我正在使用带有远程API的Bloodhound,我需要转换从远程API返回的结果。APIURL是https://www.googleapis.com/books/v1/volumes?q=quilting它返回一个具有items属性的对象,该属性是一个列表。我需要将该列表返回给Typeahead,而不是顶级对象。Bloodhound文档说thereisatransformfunctionthatissupposedtodothis,但我无法让它工作。这是我的代码:varbooks=newBloodhound({datumTokenizer:function(d){returnBlood

javascript - 在 grunt 上运行 Karma 时出现警告 'The API interface has changed'

从grunt任务运行karma时,我收到以下警告:Running"karma:unit"(karma)taskWarning:Theapiinterfacehaschanged.Pleaseuseserver=newServer(config,[done])server.start()instead.Use--forcetocontinue.Abortedduetowarnings.我已经使用我的配置测试了运行karma,都使用“运行”和“启动”karma命令,它们似乎工作正常。使用grunt--force可以完成任务,但完成时会出现警告。这是我目前使用的版本:karma0.13.0咕

javascript - Jasmine jQuery : Check if element is visible

你好,我有一个关于使用Jasmine(插件:jQuery)进行单元测试的问题我如何测试对象是否在文档的DOM中。问题是我使用了一个工具提示功能,只有在模拟事件时才会激活。当有模拟效果时,一个对象被附加到DOM上,我想检查它是否可见。it("test1:shouldinvoketheTooltip()function.",function(){spyEvent=spyOnEvent('.span_width',"mouseover");$('.span_width').simulate('mouseover');expect('mouseover').toHaveBeenTriggere

javascript - element.scrollTop 总是返回 0

我正在尝试获取元素的scrollTop位置,但它总是返回0。我做错了什么,我该如何解决?JSFiddlevarinner=document.getElementById('inner');window.addEventListener('scroll',function(){console.log(inner.scrollTop);})#outer{background-color:tan;height:1000px;}#first{background-color:bisque;height:200px;}#inner{background-color:aquamarine;heig