I'm working on a JavaScript application that has to perform two separate checks via AJAX. Depending on the result of each check, behavior differs. The case I'm interested in here is when both checks are successful. I've identified a few ways to do this, and I want to get some feedback from SO about what they think the best approach is...
The following works fine on IE6, IE7, and chrome. Not working on ff 3.0.7.
<html><head>
<script src="prototype.js" type="text/javascript" ></script>
<script type="text/javascript">
Event.observe(window, 'load',
function(){
Event.observe(document.body, 'keydown', myEventHandler);
alert('window load');
});
function myE...
I would like to provide a deafult implementation for an event generated by an instance of “Authenticator” (hereafter “objAuthenticator”).
Is this an acceptable practice to provide such method that registers for handling objAuthenticator’s own event to provide a deafult implementation?
And also, if it is an acceptable pratice, I have tw...
I want to create an app to monitor the event logs of multiple servers remotely all is good however the servers are likely to be offline now and again.
When i connect to a remote event log and the connection to the machine is lost a System.IO.IOException is thrown, I would like to hadle the error by connecting again to the remote server ...
Hi,
I use code like this to dynamically create some link-based controls:
<script type="text/javascript">
function BuildControls (id, ...)
{
var div = document.getElementById (id);
/* some stuff with var sp=document.createElement('span'); */
var a = document.createElement ('a');
a.innerHTML =...
I know that for the image onload to work you have to set the src after the onload handler was attached. However I want to attach onload handlers to images that are static in my HTML. Right now I do that in the following way (using jQquery):
<img id='img1' src='picture.jpg'>
$('#img1').load( function() {
alert('foo');
})
.attr('src'...
I would like to hook for all available element events in one call. Some thing like this:
elem.AddHandler(AnyRoutedEvent, (RoutedEventHandler)handler)
How can I do this?
...
In a webpart I have two user controls loaded. I want to be able to populate one of the controls when an event is triggered in the other control, a parameter has to be passed between the controls.
...
I have a treeView displayed on a winform.Now when i click on an xmlnode in the treeview its attributes get displayed in the listbox.Now i have divided the whole logic in UI and back end part. Now what i want that my back end class contains the method to display atrributes(name and value) of the xml node clicked and these are stored in an...
I have made a winforms application and in it i've implemented a custom richtextbox control. Now i'm refering it as a windows control (a dll file)in my project. In my program for the richtextbox i've written functionality inside it's textchanged event. Now i want to do some additional work which can happen only after the textchanged event...
How do I prevent the caret to go to the next line when the 'ENTER' key has being pressed on a text-box? In other words how to disable the 'ENTER' or 'RETURN' key on a text-box?
...
I have an input form that lets me select from multiple options, and do something when the user changes the selection. Eg,
<select onChange="javascript:doSomething();">
<option>A</option>
<option>B</option>
<option>C</option>
</select>
Now, doSomething() only gets triggered when the selection changes.
I want to trigger doSomethi...
I was using spy++ and noticed that the IE control I have embedded in a windows form was periodically calling or sending WM_PAINT when it repaints itself. I'm trying to figure out how in C# code I can perform a C# method every time this control sends WM_PAINT. I know just enough pinvoke at this point to be dangerous.
Thanks in advance,...
I need to be able to delay the event handlers for some controls (like a button) to be fired for example after 1 sec of the actual event (click event for example) .. is this possible by the .net framework ?
I use a timer and call my code from the timer's tick event as below but I am not sure if this is the best approach !
void onButtonC...
I am using the WebBrowser control in a C# application and want to handle all key events while the WebBrowser has the focus, regardless what individual content element (input field, link, etc.) is focused. I tried to simply add an event handler to browser controls KeyDown event, but this does not work. I don't want to explicitly hook a ...
Twice this week, I've read people write that an event (.net) was "thrown". I've always thought that the verb to use with events is either "fire" or "raise". I thought that "thrown" was used for exceptions, but not events ("raise" can be used for either).
Does anyone else find it confusing for events to be "thrown"?
...
I have a static event in a static method that I am temporarily attaching to, as I don't want it to hang around in memory, or get in a situation where I am firing two event handlers if I call it twice.
I have little say in whether these should be static or not, and would prefer not to have the discussion / refactor responsibility.
Initi...
function first(a){
if (a == 'a'){
return false;
}
}
function second(){
return 'a';
}
$('.c').click(first).click(second);
How to send message to other chained events? Or stop others from one?
...
Does anyone have experience in hooking onto events.
so we can modify there behavior without changing it's initial.
So lets say we want to modify the behavior of every click of a certain set of menu buttons that if you click them you would wait 30 seconds before the original callback is called.
I'm working on a project that will create ...
Will execute in order 'first, second'. I need last as first executed.
function first(){ alert('first') }
function second(){ alert('second') }
$('input').click(first).click(second);
...