javascript-events

assigning variables to DOM event listeners when iterating

I'm thinking there's some basic stuff that I'm missing here; for (var i=1; i<=5; i++) { var o = $('#asd'+i); o.mouseover(function() { console.info(i); }); } When hovering over the five different elements, I always get out the last value from iteration; the value 5. What I want is different values depending of which element ...

Does the jQuery .unbind() method only work on jQuery created events?

I am trying to unbind all event handlers for all elements that are inside a particular container. Like a DIV. But those events have been bound/registered not using jQuery. Some are bound the manual way with onclick="...." or using regular native JavaScript. But when I do something like this $('#TheDivContainer').find('div,td,tr,tbo...

Google Maps API and "rightclick" events on Macs

Note: This question is only based on Firefox. It may or may not apply to other browsers. Using the Google Maps API (v3), I can create a map and handle normal click events just fine, but when I want to handle rightclick events, it doesn't work on Macs. So, my question is how can you detect "rightclick" events from Macs with the Google ...

textbox auto expandable

how can i make textbox auto expandable through javascript ...

Scope of This JavaScript Variable

I have a question and an issue wrt the code below: My question is what is the scope of the variable loaded here. The reason why i ask this is the onload="if(loaded==1)inittextarea() code is working fine on Firefox and not IE8. Why is this happening? Is there something specific i need to do here? Or is it not a valid practice? <html> <h...

populate two select box from a select box

Hello everyone, I went through these topics for a solution to my problem but I think my question is a bit different. http://stackoverflow.com/questions/180451/using-javascript-and-jquery-to-populate-related-select-boxes-with-array-structur http://stackoverflow.com/questions/1255992/populating-a-2nd-select-box-binding-problem I have ...

Find out sandbox.open(url,null.....) execution time

I am using Jaxer.Sandbox.open(url,null,openOptions); method to fetch url contents. I want to find out time required to fetch url content. If this process took long time say more than 6 sec. then custom error page should display. ...

detect if browser supports right-click event overridding

I'm using a context-menu jquery plugin and I need to detect what browsers support this. How can this be done? I heard some versions of opera and safari don't support this right-click overriding business ...

javascript += help please

At my wits end here , any help appreciated In my json javascript live pull I have html += "<tr><td width=60 valign=top><a href='"+item.url+"' target='_blank'>"+item.site+"</a></td>"; The += seems to strip out my tr td values So I tried amending it to = which just seems to fail.. I tried setting td as a var and still no luck Any...

How do you detect the clearing of a "search" HTML5 input?

In HTML5, the search input type appears with a little X on the right that will clear the textbox (at least in Chrome, maybe others). Is there a way to detect when this X is clicked in javascript or jQuery other than, say, detecting when the box is clicked at all or doing some sort of location click-detecting (x-position/y-position)? Tha...

jQuery: How to stop propagation of a bound function not the entire event?

I have a click function bound to many elements. It is possible that sometimes these elements may sit within one another. So, the click event is bound to a child and also bound to its parent. The method is specific to the element clicked. Naturally, because of event bubbling, the child's event is fired first, and then the parents. I ca...

JQuery Validation Plugin: Prevent validation issue on nested form

I have a form on which I use validation. This form has a section for photo upload. Initially this section contains six elements with the following code: <img class="photo_upload" src="image/app/photo_upload.jpg"> I have bound a function to the click event for the class of photo_upload. This function replaces the image with a minimal ...

LearnBoost's Socket.IO-Node why onClientMessage not work

Hi, all, I tried to put the module "LearnBoost's Socket.IO-Node", all works, except event 'onClientMessage' Tell, in what there can be a problem, thanks! ...sorry for my english io.listen(server, { onClientConnect: function(client){ client.send(json({ buffer: buffer })); client.broadcast(json({ announcement: client.sessionI...

onclick event from XML Nodes

My Documents are a mixture of XML and HTML Tags. where HTML tags are pulled from xhtml namespace and mine are from various namspaces. I wanna take user interaction events from XML Nodes of my Document. I First tried <do:landingTime xhtml:onclick="fnc">20:48:29.45</do:landingTime> with no Luck. But <xhtml:span onclick="fnc"> works. So is ...

JAVASCRIPT changing on click

Hello, Id like some help changing this javascript onclick event to just load the data on page the page load... Preferably not using the body on load tag... So obviously I'd pre set the var for term inside the script term rather than the excisting on click event.. Hope that made sense <p><a id="keywordlink" href="?term=wombats">Get ke...

Validating a text box value using javascript

Hi all, I have a textbox.The user will be entering entering a number in this box.The user should enter two digits followed by a period "." and another digit.It would look something like 22.3 or 00.5 or 01.2. If the textbox is not empty,I want to enforce a function which validates the value entered by the user(and gives them an alert if ...

Trying to perform a series of actions on page unload, but the pages unloads too fast to finish them.

I have a series of actions I want to perform on page unload. Namely if a user is editing an input field, and they refresh or close browser or leave page, I want to save the contents of the field. The actions don't include an AJAX call, so I can't just make it synchronous. It's actually saving to local storage, but the page unloads b...

How to set the position .

http://www.kampyle.com/ in this url when you scroll one picture always moves. i want to know this process name.how can they do it. after click this picture it's vanish and never appear even refresh the page.How they get information i click this picture .it will be helpful for me if some one give me the solution . ...

How to stop an event for raising

Hi, I have Two fields, one textbox nad one Div element. I have onblur event for textbox, and onclick event for div element. when i click the div element the textbox's onblur event occurs and not the onclick event of div element. how to supress the onblur event when i click on the div element Thanks in advance ...

Javascript parent page redirection from iframe.

Hello to all. I need to implement parent page redirection from iframe. I know that it is impossible to do in different domains due to browsers security. However I found that links have target attribute and tried to use it in the following way: <a href="http://google.com" target="_top" id="testParentRedirect">someLink</a> It works fin...