I started with this question: http://stackoverflow.com/questions/1875693/multiple-javascript-gadgets-per-page . After reading up on how to build a jQuery plugin I've modified my OO JavaScript object into a jQuery plugin by wrapping my JS object in
(function {} { /*my object code*/ }(jQuery))
and adding a
function createMyGadget() {...
Hi!
I'm binding on the keydown event with jQuery to allow some specific characters in a textbox. I'm trying to make my code cross browser and platform compliant. My main issue is that I can't find a way to map the received key code to a valid char code, especially for key code coming from the numeric pad (decimal separator, is it a coma...
What is the most cross-browser effective way to style anchor tags without href's?
I found this article on making the styles apply in older versions of IE by throwing in an href="#". However, I am applying this about halfway down the page and find that it acts as it should; brings you to the top of the page again. This makes the page 'ju...
I know a few sits (such as my bank and my school) that kill a session after their has been idle for a set amount of time. It is my understanding that session activity is determined by users following links or at the very least from some kind of active interaction, like updating a form via ajax. Basically the server gets a request to do s...
I have some code where a <script type="text/javascript"> block is dynamically inserted.
This block contains a function, which has an <input type="button"> element above it (also dynamically inserted) call it with the onclick attribute.
However, it is not working, and Firebug says that the function is not defined when I attempt to click...
Hi,
I have a function that I wanna execute several times for different dom elements, for example element A,B,C, and D. This function is recursive, meaning that when it finishes its execution it runs again, after some timeout, for the same element.
Now, I want that element A starts the execution before B,C and D. Also B starts before D ...
Hi, I have the following code but the clear timeout doesn't work and I can't understand why, does anyone have any ideas? (Using the Prototype framework)
Thanks
function foo() {
$("navigation").observe('mouseover',
function (event) {
clearTimeout(bar);
}
).observe('mouseout',
function (event) {
setTime...
Hi there,
i am trying to organize my javascript. What i would like to do is have a class for each PAGE rather then just entering javascript straight into a js - is this good practice?
Let me explain .. thinking a long of the lines of, i would really appreciated any input, good or bad and ideas on my variable naming... of remember that ...
I've got several editable divs. I want to jump through them by pressing arrow keys (38 and 40).
Firefox 3 on Mac OS and Linux won't repeat the events on holding the key. Obviously only keypress events are supported for repetition. As the keys 38 and 40 are only supported on keydown I'm kind of stuck.
...
I am new to javascript so go easy. I am trying to create a section of a web page to highlight a company's clients. Rather than list them all, I would like to create a auto scrolling effect. For instance, upon landing on the page a visitor sees two logos in the "clients" section, and two seconds later, that area auto displays two new logo...
Hello.
I've written this code inside the HEAD tags of my HTML page. It works fine in FF, Chrome and Safaria, but doesn't in IE7. I would like to know how to fix it.
<script type="text/javascript">
if ( window.addEventListener ) {
window.addEventListener("keydown", function(e) {
alert(e.keyCode);
}, true);
}
</script>
Thanks i...
Is there a capture the on load event when dynamically adding a script tag with JavaScript in IE?
The code below works in FireFox and Chrome but not in IE.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head r...
I have a form box that I want to be always selected. I was able to get it to select everything in the box when it is clicked (using onFocus="this.select()") but I want it to be selected 100% of the time. The text in the box will be always changing, so I tried using onChange="this.select()" but that didn't work. Here's what I have:
<...
cycle:
element onclick
someobject.removeChild(objParent) - this is a parent container div of element in step 1
document.click event is never fired. In Firefox it does still fire the event.
Fix: setTimeout(object.removeChild(objParent), 0);
will not cancelbubble and continue to fire document.click in IE aswell.
Is this normal b...
I registered some click events in my code. They function properly in Firefox (Windows and Mac) but don't execute in Chrome (tried Windows and Mac beta).
The purpose of the JavaScript is to show the correct number of text inputs based on the value of the select element.
Here is the code:
http://www.savetherobots.org/users/jkost/substi...
Client has asked that a whole div is dragable, the div contains some text and an image. I converted the div to be a tag and used Mootools draggable goodies to get it all working. That is until the client clicks on the image and starts dragging it in IE. Then the browser thinks you want to drag the image around and ignores the drag and d...
Hi, I have a javascript alert popup on my page. Problem I am having with it is that instead of waiting for the user to actually click the OK button, it simply does a redirect, something it ought to do AFTER the OK button has been clicked. Can anyone please help me tweak my code so as to get this working as it ought to please?
function f...
Background: I am creating a table reminiscent of whenisgood.net, in that it has click-n-drag toggling for table elements. I want to call different types of toggling code when the left, middle, and right mouse buttons activate a mousedown event.
By using JQuery, I'm off to a good start.
$(".togglable").bind("contextmenu", function() {re...
I have a Ajax heavy application that may have a URL such as
http://mysite.com/myApp/#page=1
When a user manipulates the site, the address bar can change to something like
http://mysite.com/myApp/#page=5
without reloading the page.
My problem is the following sequence:
A user bookmarks the first URL.
The user manipulates the appl...
How can I write numeric numbers into an input field by pressing a button?
Suppose I have a button
<input type="button" value="1">
Then I want, that when numeric pad button 1 is pressed it ads numeric words just like Windows Calculator.
...