jjzjj

jaxb-runtime-parent

全部标签

javascript - chrome.runtime 是否支持发布带有可传输对象的消息?

我正在学习可转移对象:http://updates.html5rocks.com/2011/12/Transferable-Objects-Lightning-Fast它们看起来非常棒,我想在我的扩展中使用它们来加速从iframe内部到iframe外部的数据传递。我已经让这个示例代码正常工作,但它使用了WebWorker:vars=document.createElement("script");s.type="text/js-worker";s.innerHTML='console.log("iran!");';document.body.appendChild(s);varblob

javascript - 为什么内容脚本中未定义 chrome.runtime?

我有一个非常简单的chrome扩展程序,我试图将消息从后台脚本传递到内容脚本。但是chrome.runtime是未定义的。这实际上是所有代码,如您所见,几乎没有任何内容。在内容脚本中,运行时未定义。背景脚本:chrome.browserAction.onClicked.addListener(function(tab){chrome.runtime.sendMessage({action:'someAction'},function(response){console.log('Response:',response);});});内容脚本:chrome.runtime.onMessa

javascript - react : Nested onclick also triggers parent

我使用slickcarousel的react版本制作了一个类似Netflix的carousel。您可以单击一个图block,然后该图block会展开以显示该图block的详细信息。例子:这要归功于Slicks处理动态高度的能力。我想在扩展部分添加一个关闭按钮(如最右侧所示)。但这就是我遇到的问题。如果我添加一个带有onClick处理程序的关闭按钮,它将始终触发显示展开部分的父级Onclick。showExpandedonclick函数只是设置一个showDetails状态。所以我的问题是:如何通过单击关闭按钮来设置状态,而不同时触发包装父级。我尝试了event.preventDefau

javascript - typescript + 终极版 : exclude redux props in parent component

我正在为我当前的网络应用程序使用redux和typescript。定义通过@connect接收redux-actions的组件的props以及来自父级的props的最佳实践是什么?示例://mychild.tsxexportnamespaceMyChildComponent{exportinterfaceIProps{propertyFromParent:string;propertyFromRedux:string;//!!!!->ThisistheproblemactionsPropertyFromRedux:typeofMyReduxActions;//!!!!->Andthis

javascript - jQuery/JS : Get current URL parent directory

来自:http://www.site.com/example/index.html我怎样才能得到:http://www.site.com/example/并使用Javascript以及如何使用jQuery将其存储到变量中。提前致谢。 最佳答案 varmyURL="http://www.site.com/example/index.html";varmyDir=myURL.substring(0,myURL.lastIndexOf("/")+1); 关于javascript-jQuery/

javascript - IE9 中的 Jquery 2.1.1 出现错误 : 0x800a01b6 - Microsoft JScript runtime error: Object doesn't support property or method 'addEventListener'

使用VisualStudio2013,我将一个混合的Asp.NetWebforms/MVC3Web应用程序迁移到Asp.NetWebforms/MVC5.1。作为迁移的一部分,我使用NuGet包管理器将Jquery从1.9.1升级到2.1.1。当我在Chrome的VisualStudio2013调试器中运行应用程序时,我没有遇到任何问题。当我在IE9的VisualStudio2013调试器中运行应用程序时(兼容模式未打开),首先加载带有这两个脚本标记的母版页:由于此Javascript错误而失败:Unhandledexceptionatline3425,column4inhttp://

javascript - window.parent.location.href 或 window.top.location 哪个更好

我在一个项目中工作,在特定情况下我必须在错误页面上重定向。为此,我创建了Error.aspx页面。现在我正在使用window.top.location.href="../Error.aspx"并生成http://localhost/app_web/Error.aspx并且它的工作正常,除了一次(显示消息http://xyz/ErrorPage.aspx'不存在。)。那么任何人都可以建议哪个是更好的选择。谢谢 最佳答案 top“优于”parent如果您的目的是将您的页面framebust到顶层,因为您的页面可能位于一个框架内,而该框架

javascript - Vue.js: 从 "parent"Vue 获取数据

我有一个(不可更改的)DOM结构如下:.........还有两个js文件:index.js:varchild=require('childVue');module.exports=newVue({el:'#indexVue',...});childVue.js:module.exports=newVue({el:'#childVue',methods:{something:function(){//Parentdataneededhere...},...}});如图所示,我需要indexVue的数据在childVue.有什么办法可以传递给它吗?我试图将它传递给带有(v-on="clic

javascript - Angular 翻译 : Child Module translatePartialLoader urlTemplate overrides the Parent Module translatePartialLoader urlTemplate

我必须使用多个具有不同urlTemnplate的translatePartialLoader。我正在使用angular-translate-loader-pluggable。看起来子模块urltemplate覆盖了父模块urltemplate父模块配置$translateProvider.useLoader('$translatePartialLoader',{urlTemplate:__env.hostUrl+'/*****/****/localization/resource_bundle?bundle_name={part}&locale={lang}'});$translate

javascript - chrome.runtime.sendMessage 在 Chrome 扩展程序中不起作用

我正在尝试创建一个新的扩展。不久前我能够使用chrome.runtime.sendMessage函数,但现在,我已经尝试了所有方法,但它仍然无法将消息发送到后台脚本。控制台正在填充来自content-script.js但不是来自background.js的日志消息content-script.jsconsole.log("HelloWorld!s");$(document).ready(function(){console.log("DOMREADY!");$(document.documentElement).keydown(function(e){console.log("KeyH