javascript-events

Backspace doesn't delete inner html tags of a contenteditable DIV in Firefox

I have created a DIV with attribute contenteditable=true and appended children like "span" and "a" with attributes contenteditable=false. Wanted to test if the entire node be deleted with a single backspace and to my surprise Firefox couldnt delete the elements. Also this works as expected in all major desktop browsers except Firefox. An...

Global Javascript Event Handling Object Context

I have the following problem in event handlers in Javascript. I've got an object that has a mousemove event handler like so. function MyObject(){ } functino MyObject.prototype = { currentMousePosition: null, onMouseMove: function(ev){ this.currentMousePosition = this.getCoordinates(ev); }, getCoordinates: functio...

To take events on pasting some texts on text area

Hii, I have to take the paste event of a text area using JQuery. I have tried the following code but it is not working... $(document).ready(function() { $('#txtcomplaint').keyup(function() { TextCounter('txtcomplaint','counterComplaint', 1000 ); }) $('#txtcomplaint').onpaste(function() { alert() //TextCou...

jQuery live doesn't appear to bind click event.

The dynamically added links (classnames .divToggle and .removeDiv) only function if clicked twice the first time. What is preventing them from working properly right away? $(document).ready(function(){ // adds click event to links. $('a.divToggle').live('click', function(event) { // Toggles the visibility of divs. event.preventD...

UserVoice widget close button event override

I want to be able to modify or add to the onclick of the a href tag for a UserVoice widget. This code is generated for me. <a title="Close Dialog" id="uservoice-dialog-close" onclick="UserVoice.Dialog.close(); return false;" href="#close"><span style="display: none;">Close Dialog</span></a> I want to call what is there but add my own...

Moving a large set of HTML objects on the page and rebinding events with jQuery

I have a DIV with many elements that are all clickable. Each one with it's own unique event. This DIV has a "docked" mode where it shows in some other place and layout on the page, when the mode is toggled. I have to note that my main target browser is IE8. Many of the problems I'm facing here (SSSLLLLLOOOOWWWWW) just go away when I ...

How to use firebug when debugging Javascript entailing focus/blur event handling

I'm trying to use Firebug to debug some Javascript that entails blur and focus event handling, specifically some auto-complete/look-ahead functionality. The issue is that, merely by clicking on the various tabs within Firebug, such as "Console", "Script", "DOM", etcetera, the blur() event in my application is being fired, and then the f...

Is it possible to get the location/position of the mouse cursor on document load event. (in javascript)

Hi All, Just wondering if its possible to get the x/y location of the mouse from the onload event of the document (before any mousemove events). Thanks Guido ...

need mouseover to stay highlighted while viewing the page

On this site: http://www.winteradagency.com/mrw/real_estate.php the navigation uses a javascript that highlights the selections as you mouseover them. Is there an easy way to change the code so that the page the user is on stays highlighted? That helps them see what page they're on and allows for better navigation. thanks ...

Check if the spacebar is being pressed and the mouse is moving at the same time with jQuery?

Is there a way to check if the space bar and at the same time track what direction the mouse is moving and how far etc. Point of this is that I want to replicate how Photoshop scrolls when you hold the space bar, left mouse button and you move the mouse, but without having to hold down the left mouse button. ...

How to do multiple file upload validation using JS/Mootools/JQuery?

hi all busy developers, I had a form in which two elements are there - <form> <table id="nwtbl" width="100%"> <tr> <td> <select name="prof_img_type[]"> <option value="">Select Image Caption</option> <option value="a">ABC</option> <option value="x">XYZ</option> ...

IE onbeforeunload not firing ExtenralInterface callback.

I have a Flash movie embeded with swfobject in a html container. Through ExternalInterface I have registered a javascript function to fire callback to my flash app. ExternalInterface.addCallback("notifyClose", notifyOnClose ); The javascript function is added as an event listerner to fire onbeforeunload. <script language="JavaScript"...

Javascript dispatchEvent

Hey... I'm using Flash a lot and my classes uses EventDispatcher class which allowes me to define custom events of a class. How can I do this in javascript. I would like to do something like this: var MyClass = function() { }; MyClass.prototype = { test : function() { dispatchEvent('ON_TEST'); } }; var mc = new MyClass(); mc.a...

Capturing Shift key activity using JavaScript

I am using JavaScript and jQuery and would like to call a function when the user releases the Shift key. The code I came up with works in all the browsers I've tested so far, however the following warning appears in the error console using Firefox 3.5.7. I've tried jQuery 1.2.6, 1.3.2 and 1.4.1. Warning: The 'charCode' property of a ...

Does calling `click()` in jQuery only trigger jQuery attached events?

I have a Magento site, which includes the prototype JavaScript library. Some time ago, I added jQuery as well. Before that however, I'd included a prototype based Lightbox. It was triggered by adding the attribute rel="lightbox[gallery]". Now I'd like to make a lightbox appear on page load. I know nothing about prototype, so I tried c...

Jquery - Delay mouseout event.

Is there a way to make jquery wait a certain about amount of time before mouseout event is fired? It is firing too early at the moment and I'd prefer to wait 500ms before it evaluates the mouse out. An example of the code I'm using below. $('.under-construction',this).bind({ mousemove: function(e) { setToolTipPosition(this,...

how to iterate textbox array in JS

hi all, i have text boxes in HTML Like - <table id="tbl"> <tr> <td><input type="text" name="t1[]"></td> <td><input type="text" name="t2[]"></td> <td><input type="text" name="t3[]"></td> </tr> <tr> <td><input type="text" name="t1[]"></td> <td><input type="text" name="t2[]"></td> <td><input type="text" nam...

Why can't I use jQuery to fire an AJAX request from an unload event handler?

I have the following code, intended to log the event when a user closes a chat window: $(window).unload( function() { test(); }); function test() { alert("Hi"); $.ajax({ type: "POST", url: baseUrl + 'Index/test', data: "user_id=" + "Nisanth" + "& chat_id=" + 2, success: function(msg){ alert(msg...

Clear contents on click

All, In the following code <INPUT TYPE="radio" name="1" id="1" VALUE="1" <?php echo $checked1 ?>><font size="2">1</font> <INPUT TYPE="radio" name="2" id="2" VALUE="2" <?php echo $checked2 ?>><font size="2">2</font> <TEXTAREA name="names" id="names" rows="15" cols="65"><?php echo $names ?></TEXTAREA> If the radio button 1 selected for...

How to retreive java script function value in webview component

How can I retrieve the java script function value from a web page loaded withing a webview component?? ...