Search Results

Search found 12948 results on 518 pages for 'mouse events'.

Page 129/518 | < Previous Page | 125 126 127 128 129 130 131 132 133 134 135 136  | Next Page >

  • where is the best place to place a javascript snippet to alter the DOM of a page before it renders

    - by icepack
    I have a few dynamic pages and I want to alter certain elements before the page has fully rendered. My snippet is something like document.body.getElementById("change").innerHTML = "<img src..."; I do not have access to change the content server side. Where is the best place to put the snippet to have the code run before the page it has rendered? Rather, is putting the javascript in either the HEAD (inside the window.onload event?) or before the closing BODY(not inside an event listener) optimal?

    Read the article

  • Firefox DOMContentLoaded event problem

    - by mck89
    Hi, i've created a script that works with the Dom so it has to wait until the Dom is ready before execute every operation. I want that this script can be included in two ways: In the head tag so that it is loaded before the Dom is ready. I've used document.addEventListener("DOMContentLoaded",function(){...},false) for this and it works well Loaded dinamically when the Dom is already loaded. In this case the script doesn't work because for some reasons if the Dom is already loaded the DOMContentLoaded event isn't fired So i want to know, is there a way to check if the Dom is already loaded so that the script can execute the code without using the DOMContentLoaded event?

    Read the article

  • Accelerator UI in JavaScript

    - by sonofdelphi
    Can I create something like an Internet Explorer accelerator using JavaScript on the client-side? I want a clickable icon to show up when the user selects some text on the page. What is the event I should wait on?

    Read the article

  • Assign delegate event handler from dynamically added child control

    - by mickyjtwin
    I have a control that handles commenting. In this control, I have set a delegate event handler for sending an email. I then have various types of controls, e.g. blog, articles etc, each of which may or may not have the commenting control added (which is done dynamically with me not knowing the id's), i.e. the commenting control is added outside this control. Each of these controls handles it's emailing differently(hence the event). What I'm trying to determine, is how to assign the event in the parent control. At the moment, I'm having to recursively search through all the controls on the page until I find the comment control, and set it that way. Example below explains: COMMENTING CONTROL public delegate void Commenting_OnSendEmail(); public partial class Commenting : UserControl { public Commenting_OnSendEmail OnComment_SendEmail(); private void Page_Load(object sender, EventArgs e) { if(OnComment_SendEmail != null) { OnComment_SendEmail(); } } } PARENT CONTROL public partial class Blog : UserControl { private void Page_Load(object sender, EventArgs e) { Commenting comControl = (Commenting)this.FindControl<Commenting>(this); if(comControl != null) { comCtrol.OnComment_SendEmail += new Commenting_OnSendMail(Blog_Comment_OnSendEmail); } } } Is there an easier way?

    Read the article

  • Show last command with up arrow on a linux c shell

    - by nunos
    I have implemented a simple linux shell in c. Now, I am adding some features and one I immediately thought about was to be able to show the last commands with the up arrow. Question 1: However, I have no idea how to accomplish this. Do you? Question 2: Any comment on how to store the "history" commands are also appreciated. I suppose something like a queue which allows access to all elements would be a good idea. Am I wrong? Do I have to implement it or is there already some good implementation out there I should know about? Thanks.

    Read the article

  • Why does a checkbox's "checked" attribute return the opposite of it's actual value on click event?

    - by Kappers
    I've got the following HTML <li><input type="checkbox" /><label>This is the label!</label></li> I bound a click event to the li, and let the click event bubble up to the li before doing anything else. $('li').each(function(i){ var item = $(this); var checkbox = $("input[type='checkbox']", item); item.bind('click', function(e){ var isChecked = checkbox.is(':checked'); console.log(isChecked); e.stopPropagation(); }); }); Starting with an unchecked checkbox, when the click event fires, isChecked returns true when I click on the checkbox, but returns false when I click on the label or li. Does anyone know why?

    Read the article

  • Is there a way to know in VB.NET if a handler has been registered for an event?

    - by Seth Spearman
    In C# I can test for this... public event EventHandler Trigger; protected void OnTrigger(EventArgs e) { if (Trigger != null) Trigger(this, e); } Is there a way to do this in VB.NET? Test for null I mean? MORE INFO I forgot to mention. I have classes written in C# but I am writing my unit tests in VB.NET. I am trying this in the unit test... If myObject.Trigger IsNot Nothing Then 'do something End If This is causing a compile time error which says ... "Public Event Trigger is an Event and cannot be called directly. Use the RaiseEvent statement to raise an event." Seth

    Read the article

  • Printing contents of a div

    - by Hulk
    The contents of the following div re derived dynamically. i.e, A table is added dynamically to this div with some button .My question is how to print the content of this div(window.print) and not other things in the page <div id="newdiv" name="newdiv"></div> Thanks..............

    Read the article

  • GWT removeHandler on first event notification

    - by Keith
    I want to remove a GWT event handler the first time I receive an event. I also want to avoid polluting my class with tracking registration objects that aren't really necessary. I currently have it coded as: final HandlerRegistration[] registrationRef = new HandlerRegistration[1]; registrationRef[0] = dialog.addFooHandler(new FooHandler() { public void onFoo(FooEvent event) { HandlerRegistration removeMe = registrationRef[0]; if(removeMe != null) { removeMe.removeHandler(); } // do stuff here } }); but the use of registrationRef makes the code less readable. Is there a better way to do this without adding variables to my class?

    Read the article

  • How to REALLY focus a link using jQuery / javascript

    - by Bobby Jack
    Calling the jQuery focus() method on a link appears to only partially focus the link. Whilst the link has focus to the extent that pressing ENTER follows the link, it doesn't take on the default outline styling (or adopt any styling set via the :focus pseudo-class), nor is the tab-order correctly 'entered'. Any ideas on how to resolve this? (results observed in Firefox 3.6.2)

    Read the article

  • jQuery: how to know when an external JS has finished?

    - by andufo
    Hi, i need to execute specific javascript instructions AFTER an external javascript finishes its own process. (function(){ var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = 'http://xxxxxxxx.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); How can jQuery know when that .js has finished doing what it does?

    Read the article

  • C# Simple Event Handler for Setting Alarm

    - by yeeen
    Why does the following line "alarm.AlarmEvent += new AlarmEventHandler(alarm_Sound);" gives me "An object reference is required for the non-static field, method, or property 'AlarmClock.Alarm.alarm_Sound(object, System.EventArgs)'" public static void Main(string[] args) { Alarm alarm = new Alarm(new DateTime(2010, 4, 7, 23, 2, 0)); alarm.Set(); alarm.AlarmEvent += new AlarmEventHandler(alarm_Sound); } Full source code here: Program.cs AlarmEventArgs

    Read the article

  • User Control's Page Init Event Not Firing After Another User Control Using

    - by Murat
    I have an user control. I add dynamicly control to this control on its Page Init. This user control's parent Page's every postback, its page init works fine. After I added an different user control to Page. In Second User control, user select photos and uploads them with asyncfileupload control(AJAX). And I save all of them with a button at the end of Page. In EveryPostBack Parent Page Load event works. If I dont select any photo from Second User Control, First User Control's Page Init event works fine when I click Save Button. But if I select a photo, first User Control dont work. What is the problem?

    Read the article

  • Help with Event-Based Components

    - by Joel in Gö
    I have started to look at Event-Based Components (EBCs), a programming method currently being explored by Ralf Wesphal in Germany, in particular. This is a really interesting and promising way to architect a software solution, and gets close to the age-old idea of being able to stick software components together like Lego :) A good starting point is the Channel 9 video here, and there is a fair bit of discussion in German at the Google Group on EBCs. I am however looking for more concrete examples - while the ideas look great, I am finding it hard to translate them into real code for anything more than a trivial project. Does anyone know of any good code examples (in C# preferably), or any more good sites where EBCs are discussed?

    Read the article

  • return multiple values?

    - by user295189
    I am trying to return two values in javascript is that possible? var newCodes = function(){ var dCodes = fg.codecsCodes.rs; // Linked ICDs var dCodes2 = fg.codecsCodes2.rs; //Linked CPTs return dCodes, dCodes2; }; Thanks

    Read the article

  • form change with javascript

    - by aslum
    I have two drop down lists <select name="branch"> <option value="b">Blacksburg</option> <option value="c">Christiansburg</option> <option value="f">Floyd</option> <option value="m">Meadowbrook</option> </select> but I would like the second list to be different based upon what is selected from the first list. So FREX Blacksburg's might be <select name="room"> <option value="Kitchen">Kitchen Side</option> <option value="Closet">Closet Side</option> <option value="Full">Full Room</option> </select While Christiansburg's is <select name="room"> <option value="Window">Window Side</option> <option value="Door">Door Side</option> <option value="Full">Full Room</option> and of course the options are also different for the other branches... Is it possible to change the second drop down list based on what they select for the first one? I have used javascript a teensy bit, but not much so please explain in detail. Thanks!

    Read the article

  • Toggle block in jQuery

    - by user201140
    I'd like to click a header link and have the block directly underneath hide or show (with slideToggle) Thanks <div class='header'><a href='#'>Header</a></div> <div class='block'> <div class='test>Some Text</div> <div class='test>Some Text</div> <div class='test>Some Text</div> </div> <div class='header'><a href='#'>Header</a></div> <div class='block'> <div class='test>Some Text</div> <div class='test>Some Text</div> <div class='test>Some Text</div> </div> <div class='header'><a href='#'>Header</a></div> <div class='block'> <div class='test>Some Text</div> <div class='test>Some Text</div> <div class='test>Some Text</div> </div>

    Read the article

  • Are delegates copied during assignment to an event?

    - by Sir Psycho
    Hi, The following code seems to execute the FileRetrieved event more than once. I thought delegates were a reference type. I was expecting this to execute once. I'm going to take a guess and say that the reference is being passed by value, therefore copied but I don't like guesswork :-) public delegate void DirListEvent<T>(T dirItem); void Main() { DirListEvent<string> printFilename = s => { Console.WriteLine (s); }; var obj = new DirectoryLister(); obj.FileRetrieved += printFilename; obj.FileRetrieved += printFilename; obj.GetDirListing(); } public class DirectoryLister { public event DirListEvent<string> FileRetrieved; public DirectoryLister() { FileRetrieved += delegate {}; } public void GetDirListing() { foreach (var file in Directory.GetFiles(@"C:\")) { FileRetrieved(file); } } }

    Read the article

  • Javascript Object.Watch for all browsers?

    - by SeanW
    Hey all, I was looking for an easy way to monitor an object or variable for changes, and I found Object.Watch that's supported in Mozilla browsers, but not IE. So I started searching around to see if anyone had written some sort of equivalent. About the only thing I've found has been a jQuery plugin (http://plugins.jquery.com/files/jquery-watch.js.txt), but I'm not sure if that's the best way to go. I certainly use jQuery in most of my projects, so I'm not worried about the jQuery aspect... Anyway, the question: can someone show me a working example of that jQuery plugin? I'm having problems making it work... Or, does anyone know of any better alternatives that would work cross browser? Thanks! Update after answers: Thanks everyone for the responses! I tried out the code posted here: http://webreflection.blogspot.com/2009/01/internet-explorer-object-watch.html But I couldn't seem to make it work with IE. The code below works fine in FireFox, but does nothing in IE. In Firefox, each time watcher.status is changed, the document.write in watcher.watch is called and you can see the output on the page. In IE, that doesn't happen, but I can see that watcher.status is updating the value, because the last document.write shows the correct value (in both IE and FF). But, if the callback function isn't called, then that's kind of pointless... :) Am I missing something? var options = {'status': 'no status'}, watcher = createWatcher(options); watcher.watch("status", function(prop, oldValue, newValue) { document.write("old: " + oldValue + ", new: " + newValue + "<br>"); return newValue; }); watcher.status = 'asdf'; watcher.status = '1234'; document.write(watcher.status + "<br>");

    Read the article

  • Why does Event intent in android not return a result?

    - by dhaval
    I am creating a event using Intent intent = new Intent(Intent.ACTION_EDIT); intent.setType("vnd.android.cursor.item/event"); And invoking the intent using startActivityForResult(intent, Constants.LINK_CALENDER); There is nothing returned to call in onActivityResult(int requestCode, int resultCode, Intent data) It always returns data=null ie., returned intent result is always null. I am trying to retrieve the "Done/Revert" state of calender event just created and some identity so that i can open the event again in future from elsewhere in code.

    Read the article

  • is it possible to tell if DOM was modified, and which part?

    - by mkoryak
    Are there any practical ways to tell what part of the DOM was modified if you know that it will be modified? I am writing a plugin that will be running along with javascript that i did not write. an event will be triggered before DOM is modified, and one event will be triggered after the modification. It is my job to decide what was changed. is this possible, and if so what is the least horrible way to do this?

    Read the article

  • Interrupting Prototype handler, alert() vs event.stop()

    - by lxs
    Here's the test page I'm using. This version works fine, forwarding to #success: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html><head> <script type="text/javascript" src="prototype.js"></script> </head><body> <form id='form' method='POST' action='#fail'> <button id='button'>Oh my giddy aunt!</button> <script type="text/javascript"> var fn = function() { $('form').action = "#success"; $('form').submit(); } $('button').observe('mousedown', fn); </script> </form> </body></html> If I empty the handler: var fn = function() { } The form is submitted, but of course we are sent to #fail this time. With an alert in the handler: var fn = function() { alert("omg!"); } The form is not submitted. This is awfully curious. With event.stop(), which is supposed to prevent the browser taking the default action: var fn = function(event) { event.stop(); } We are sent to #fail. So alert() is more effective at preventing a submission than event.stop(). What gives? I'm using Firefox 3.6.3 and Prototype 1.6.0.3. This behaviour also appears in Prototype 1.6.1.

    Read the article

< Previous Page | 125 126 127 128 129 130 131 132 133 134 135 136  | Next Page >