custom-event

CustomEvent.detail “tainted”?

淺唱寂寞╮ 提交于 2020-01-15 07:02:19
问题 I'm developing a Chrome extension to add convenience to a website. I have access to the page's DOM, but I also need to interact with the "first-party" JS on that page, which I cannot do from my extension. I can inject arbitrary tags into the page (most notably also <script> tags), but since escaping strings like { html: '<div onclick="doSomething(this, \'someName\')"></div>' } is a real pain, I'd like to keep the injected code at an absolute minimum. I tried injecting event listeners into the

How to determine if browser supports properties on event object?

ⅰ亾dé卋堺 提交于 2020-01-06 08:01:06
问题 Some touch-enabled browsers (such as Mobile Safari) have a scale and rotation property available on their event object for events such as touchmove . I can detect support for the scale property like so... document.body.addEventListener("touchmove", function(event) { var supportsScaleProperty = !!event.scale; }); However, is there a way to detect it without having to bind a listener and then look for the property in the callback? For example, if this worked? var supportsScaleProperty = !!(new

Problems with ASP.NET and custom events

最后都变了- 提交于 2019-12-25 02:43:01
问题 I have a problem when handling the ReceiveCompleted event of a MessageQueue in ASP.NET. It catches it successfully, but every changes applied to the Controls of the page have no effect. This is what I've got: .ASPX <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="False"> <ContentTemplate> <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> <br /> <asp:Label ID="Label2" runat="server" Text="Label"></asp:Label> </ContentTemplate> </asp

How to create a custom event in jquery? [closed]

社会主义新天地 提交于 2019-12-22 01:06:37
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . How can I create a custom event in jquery? I want to create a selection draw event. so that I can replace the add note button on this plugin JQuery Image Annotation with my event. I want to be able to directly

How do I detect a transition end without a JavaScript library?

我是研究僧i 提交于 2019-12-19 05:32:17
问题 I'd like to delete an object after it's done animating with a CSS transition, but I'm not able to use a JavaScript library. How do I detect when the animation is done? Do I use a callback or custom event somehow? 回答1: element.addEventListener('transitionend', function(event) { alert("CSS Property completed: " + event.propertyName); }, false ); For now, the exact event name has not been standardized. Here's a quote from MDN: There is a single event that is fired when transitions complete. In

Send data from popup to main application.

和自甴很熟 提交于 2019-12-13 05:49:07
问题 I'm not getting the answer I'm looking for. I want to send the request data i get to the main application. <?xml version="1.0" encoding="utf-8"?> <mx:TitleWindow xmlns:mx="http://www.adobe.com/2006/mxml" remove="titlewindow1_removeHandler(event)" width="400" height="220" layout="absolute" title="USER LOGIN"> <mx:Metadata> [Event(name="commEvent", type="flash.events.Event")] </mx:Metadata> <mx:Script> <![CDATA[ import data.Data; import mx.events.FlexEvent; import mx.managers.PopUpManager;

Create custom wpf event

…衆ロ難τιáo~ 提交于 2019-12-04 10:11:55
问题 i've created an UserControl for Database connection where user input Username and Password for a connection. This UserControl is in a MainWindow.xaml Now, in code behind of my UserControl i create a MSSQL connection. If login Successfully, i want to Raise a custom event to expose in MainWindow. For example in MyUserControl.xaml.cs try { using (SqlConnection sqlConn = new SqlConnection(connection)) { sqlConn.Open(); MessageBox.Show("Connessione Riuscita!", "Connessione a " + TextIP.Text,

Firing an event / function on a property? (C#)

≡放荡痞女 提交于 2019-12-03 17:31:24
问题 I am using a class that I cannot edit, it has a property (a boolean) of which it would be nice to be informed when it changes, I can't edit the properties get or set as I am importing the class from a .dll (which I don't have the code for). How do I create an event/function that is fired when the property is changed? Additional It is only changed within its own class, directly to the underlying private variable. E.g. private bool m_MyValue = false; public bool MyValue { get { return m_MyValue

Object doesn't support this action IE9 with CustomEvent Initialization

ε祈祈猫儿з 提交于 2019-12-03 11:34:08
问题 I am getting the following error in IE9: "Object doesn't support this action". There are various question about this, but mine is specifically for the following code: var myEvent = new CustomEvent("additem"); From my understanding, CustomEvent is supported in IE9 as a DOM manipulation command. This works fine in Chrome without any exception. Anyone has this problem and know how to solve it? Thanks. 回答1: Afaik custom events are not supported in IE, only in normal browsers. I suggest using a

Firing an event / function on a property? (C#)

天大地大妈咪最大 提交于 2019-12-03 06:22:16
I am using a class that I cannot edit, it has a property (a boolean) of which it would be nice to be informed when it changes, I can't edit the properties get or set as I am importing the class from a .dll (which I don't have the code for). How do I create an event/function that is fired when the property is changed? Additional It is only changed within its own class, directly to the underlying private variable. E.g. private bool m_MyValue = false; public bool MyValue { get { return m_MyValue; } } private void SomeFunction() { m_MyValue = true; } You can't, basically... not without using