javascript-events

Multiple Frames, JavaScript, and Navigation History

Hi folks, I inherited an eCom site which operates by multiple frames. There is a sidebar frame that may have a list of products in a category or be a blank page. And there is a main content frame that will hold category items, or content, or the shopping cart. It is a nightmare of spaghetti code includes and I don't have access to th...

JavaScript & JSP

Hi there, Firstly, I have done my research and already know that JavaScript = client JSPs = server side. I don't want to waste your time. My situation is that I want to execute JSP code from an event (not from a HTML form). I have a HTML link (<a href="...">XXX</a>), which is NOT within <form> tags; it just an ordinary HTML link. Thro...

Proper way to document or diagram custom event models in the DOM

Imagine you have a bunch of components and subcomponents in your web application. You want to keep track of how all the custom events you added behave. Are there established ways to diagram or document these behaviors? Here are some things the documentation should show: The actual nesting of relevant DOM elements of the various compon...

Custom event logging for Javascript frameworks

Imagine I have a web application with nice components coded up with your favorite Javascript library. I make heavy use of custom events to reduce the dependencies between these components so you can easily place them in multiple contexts, repeat them on the page, and/or nest them as I see fit. This is a lovely picture, but debugging can...

how to make a click or double click on a word on a webpage to trigger an event handler?

for a page like http://www.answers.com if the user double clicks on any word in the page, a pop up box will show up and shows the definition for that word. I can think of a way to use DOM scripting to break up all words in the page and then make each of them go under a separate "span" element... but otherwise isn't it true that if all...

Prevent click event from firing when dblclick event fires

I'm handling both the click and dblclick event on a DOM element. Each one carries out a different command, but I find that when double clicking on the element, in addition to firing the double click event, the click event is also fired twice. What is the best approach for preventing this behavior? ...

Changing Javascript Focus in onClick event?

Note: A possible solution needs only work in Firefox 3.0, my app doesn't allow access from IE! =) I have a link that, when clicked, will display a lightbox to the user: <a href="#" onclick="show_lightbox();return false;">show lightbox</a> My problem is that when the lightbox is displayed, the focus remains on the link. So if the user...

How to get the html List value through Javascript?

I am trying to get values from html list <li>. <ul> <li><a>Main Menu</a> <ul class="leftbutton" > <li value="List1"><a>Sampe 1</a></li> <li value="List2"><a>Sample 2</a></li> <li value="List3"><a>Sample 3</a></li> <li value="List4"><a>Sample 4</a></li> <li value="List5"><a>Sample 5</a></li> <...

Javascript:Enter key press event

I have a form with two text boxes, one select drop down and one radio button. When the enter key is pressed, I want to call a javascript function(User defined). But when I press the enter key the form is getting submitted. How do I prevent the form from being submitted when the enter key is pressed. ...

How can I programmatically invoke an onclick() event from a anchor tag while keeping the ‘this’ reference in the onclick function?

Is it possible to programmatically invoke a onClick-event for an anchor tag, while maintaining the 'this' reference to the anchor? The following doesn't work... (at least not in Firefox: document.getElementById('linkid').click() is not a function) <script type="text/javascript"> function doOnClick() { document.getElementByI...

Attaching and Detaching events to/from Virtual Earth maps

I don't think this is particularly quirky, but in an attempt to control my JavaScript code (if it is possible to really control JavaScript ;-) ) I have been wrapping all of my client-side JavaScript in lovely objects. Or as lovely as I can make them anyway. One of the first issues I came across was attaching events to anything from with...

Is it possible to prevent document scrolling when arrow keys are pressed?

Very straightforward: Is it possible to prevent the browser from scrolling when a user pressed arrow keys? ...

JavaScript : Simulate Mouse Over in code

I'm attempting to write a vimperator plugin to allow use of hints mode to simulate mouse over on drop down menus. I have the hints mode working and can correctly choose elements that have mouseover events attached. The problem is my function to simulate the mouse over is not working. This is what I currently have: function SimulateMo...

Javascript 'onkey*' events not working in Links browser

Anyone know anything about the Links browser? I am developing an application for Links (text mode) that is running on a terminal using Linux. The problem is that none of the 'on key' events (down, up, or press) will register. Here is the Javascript I am using: <body onload="Alert()" onkeydown="CheckKey(event.keyCode)"> <script type...

When calling a Javascript function, how do I set a custom value of "this"?

I'm using jQuery and I have a function that serves as an event callback, and so in that function "this" represents the object that that captured the event. However, there's an instance where I want to call the function explicitly from another function - how do I set what "this" will equal within the function in this case? For example: ...

CollapsiblePanelExtender Click Event

I have a a CollapsiblePanelExtender with the usual extend and collapse buttons....I would like to have a click event fire off when the extender is extended and a different click event fire off when the extender is collapsed. But the most important event is when it is extended. I could live without a click even on collapse. Most of the ...

How do I change the name of multiple selected html values?

I have about 20 check boxes. When the user selects these and then uses an alternate submit button, I need to change the name of the name/value pair, for the selected inputs. Why does this function only change the name of every other selected input? function sub_d() { for (i = 0; i < document.checks.OGname.length; i++) //for all ...

Javascript function not working in Mozilla

hi, Below function is working fine for IE, but not working for Mozilla and other browsers function CloseSession() { alert("Inside Close"); if ((window.event.clientX < 0) || (window.event.clientY<0)) { alert("Inside Events"); location.href = '/forms/sessionkill.aspx'; } } What...

"Please wait" image on every user action with ASP.NET 3.5

Hello, In our ASP.NET 3.5 application, we would like to implement a "Please wait.." feature : on every user action (button click, tab change, etc.) we would display a little spinner on top of the page (actually in a separate frame that we use already have). We thought of this solution : "hijack" the _doPostBack to intercept every e...

Update ValidationSummary list on control blurs?

A ValidationSummary will show a list of errors on postback. As each field is fixed, it's validator is fired, and any validation text will disappear. I want to automatically update the ValidationSummary as well. The following works fine: <asp:TextBox ID="ForenameTextBox" onblur="ValidationSummaryOnSubmit()" runat="server" /> but this ...