javascript-events

javascript - retrieving html control by specifying coordinates

how can i get the id of a html control just by specifying the coordinates of a triggered event (like onmousedown, onmouseup, onclick, etc..). the coordinates can be got by e.clientX , e.clientY where e is the event object. the idea is to get the id of control on which a click event is done without having any onClick event in that con...

jquery MultiSelect submit form on change

I am using the excellent jQuery MultiSelect plugin as advertised here: http://abeautifulsite.net/notebook/62 The problem I have is that I would like to submit the form when the values have changed. Having all sorts of trouble getting this one working, does anyone have insight into how to achieve this? Also open to alternative jQuery p...

Javascript - onload, onclick events

I have a method that is instantiated on page load. The method fires two events, window.onload and image.onclick. The problem is only one of the event works at any given time (ie: if i comment image.onclick method, window.onload method works). How do i get both to work? This works fine in Firefox (mozilla) but not in IE example test.me...

Simulate JavaScript Key Events

Is it possible to simulate key press events programatically in JavaScript ...

Minimize browser window using javascript.

Is there a javascript or jQuery method to minimize the current browser window? ...

Dealing with javascript events applicable only for certain content

I'm having trouble understanding conceptually what I should do while trying to make my first large javascript web application. Depending on which tab a user has selected, I show different content inside a container. The content is more than just text and uses different javascript functions and events. I am using the Yahoo! UI Library'...

Is there a Flash onload error event?

Hi people, Is there any way of detecting an error when a Flash-plugin loads its content? Basically, what I want to do is to provide some alternate content, in case something goes wrong when the Flash-plugin tries to load it's .swf file. The .swf file is managed by the client and hence I want to create some kind of fall back default c...

How to avoid magic numbers when matching an event.keyCode in javascript

Can I avoid magic numbers when matching keypresses in javascript? An example would be using 13 to match the enter key. I could specify my own constants, but I don't know if these values are stable enough across different platforms/browsers/locales. ...

Silverlight listener for Java-script events on host web page

How do I set up a listener in Silverlight to listen for a javascript event thrown from the host web page? ...

How do I register a javascript event handler to an element that hasn't been added to the page yet

I'm trying to build a greasemonkey script which will dynamically create tables of data based on user interaction with... other dynamically created tables of data. My problem is that I'm having to make two passes every time I create a table: one to create the table, and another to go grab all of the objects in the table I want to add even...

Problem with (X) button in window.

Hi, How to disable (X) button in window. I tried with some properties like titlebar=no/0 in window.open but it is not working fine. Can anybody help me with this query. Thanks in advance ...

Enabling back/fwd key events for an Ajax Application

I have an application which works heavily on AJAX. However I want to have navigation functionalities in it. To spoof the url, I am changing the location.hash, to generate URL. But if i use back/fwd, only the url changes, but page wont reload. How can I override the hstory.back to reload the page. ...

Javascript Events Not Bubbling Up When Using Text Box Watermark

I'm trying to implement a simple watermark on a text box that disappears when the text box gains focus. I found this jQuery plugin that appeared to work great: http://remysharp.com/2007/01/25/jquery-tutorial-text-box-hints/ The watermark worked just as advertised with this code: <script type="text/javascript" src="/includes/_jQuery/_...

jQuery Multiple Event Handlers - How to Cancel?

I have two functions bound to a click event at two different times (using jQuery). The order in which they are fired is significant. They are firing in the correct order. The problem is, when the first function returns false, the second function is still firing! How can I properly cancel the event? Example code: $(document).click(f...

jQuery Events params through chain

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? ...

Capture link clickthrough events from Javascript

In order to track the overall user clickstream, I'd like to fire a javascript event, if the user right-clicks, and select "Open in new Tab" (or middle-clicks in most browsers) on a link. Most of these links are linking outside of my site, and I'd like to interfere with overall browser experience (such as: status bar, etc) as little as p...

Problem with disabling submit buttons on form submit

Greetings I am using the jquery disable on submit plug-in but I have a problem. If I disable the submit buttons they dont get passed back to the server so I cant tell which button was pressed. Is this normal? Is there anything I can do about it? I really dont want to retool my website so I have to set a variable on form submission to t...

How do I stop the Back and Refresh buttons from resubmitting my form?

I am doing web development. I have a page to do with credit card, which when user click "refresh" or "Back", the transaction will be performed one more time, which is unwanted. This include Browser top left "Back" & "Refresh" button, "right click->Refresh/Back", press "F5" key. This is to be done on certain cgi page only, not all of the...

How can I temporarily prevent a scrollable div from scrolling?

Here is my current situation: I have a web page containing a couple scrollable divs. Each of those divs contains a number of objects. I am using YUI to display popup menus of actions that can be performed on each object. Each object has its own menu associated with it that is constructed and displayed dynamically. The popup menus can be...

javascript resize event firing multiple times while dragging the resize handle

I was hoping this jQuery plug-in would work, but it didn't http://noteslog.com/post/how-to-fix-the-resize-event-in-ie I added a comment to his site, but they're moderated, so you might not see it yet. But anyhow, let me explain my desire. I want a "resize" type of event to be fired when the user either pauses his resize, and/or comple...