javascript-events

innerHTML and event delegation

Hello, I have a containing div that has multiple divs within which is updated every 25ms using innerHTML (for performance reasons). I have tried using event delegation to capture events but nothing I seem to do captures the click event. I think this may be due to the speed that the contents are getting updated. Any ideas would be very w...

Virtual Earth adding pushpins by address - events firing out of order

I’ve been working on a mapping project to display service orders for a utility company but I’m having some issues getting the numbering on my pins and the info boxes. The following is a small segment of the page I’m working with to demonstrate the issue. http://www.evocommand.com/junk_delete_me/virtual_earth_testing/VirtualEarthTest.htm...

Prototype to JQuery - how to access originator of event

Hi there I'm coming from a Prototype background and looking into JQuery. I'd like to know the 'right' way to do attach a click event to a bunch of elements, but then know in the event handler which one of my elements was clicked. I've come up with the following: MYNS.CarouselHelper.prototype.attachImgHandlers = function () { $j("...

Implementing web chat,how do I get typing status ?

Can someone illustrate how I can get typing status of the other party with javascript? UPDATE Can someone recommend a one-to-one open source chatting application,preferably written in PHP? I only found open source chatting rooms which are for chatting among all onliners,but I just need a one-to-one chatting. ...

Virtual Earth / Bing maps javascript file size

I am working with a site that uses virtual earth for its mapping. Unfortunately the file size of the referenced javascript file, ecn.dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.2, is 200 something kb before being expanded (to 970kb). As our site runs under https this file is not cached on the client, and can cause a few seconds d...

Event firing sequence for a submit button.

Say a submit button has a click event handler as well (yes, it's wrong, but that's really the code I'm working on). And the click handler sets a value in a field of the form that's about to be submitted. So when the submit button is clicked: What will fire first, the form submit event or the click event? Will the value set in the for...

JavaScript: how to create a JS event that requires 2 seperate JS files to be loaded first while downloading them asynchronously?

I want to perform asynchronous JavaScript downloads of two files that have dependencies attached to them. // asynch download of jquery and gmaps function addScript(url) { var script = document.createElement('script'); script.src = url; document.getElementsByTagName('head')[0].appendChild(script); } addScript('http://google....

ExtJS : handling browser exit event (click on cross-exit)

Hi everybody, First of all, thank you for reading my question. I would like to know if there is any way to handle the browser exit event. For example, I would like to send a query when the user click on the cross-exit or simply close his browser. Thanks a lot. $t0rM ...

Drag and drop an image from desktop to a web text editor (implementation in javascript)

I tried to write reasonably short title but i failed i guess.. Hi everybody here's what i'm trying to do: I want to implement a web text editor able to recognize when the user drag a image file over it's editing surface and it automa(gically) starts the upload and insert the image near the cursor position. In other words i don't want t...

Multiple onbeforeunload() and onunload() events

I have a strange issue from a client in that our code, which they include uses onbeforeunload() to trigger a dialog, but they are also including another companies code which also binds this event handler. Is it possible for both to execute at the same time? I've been reading this, http://oreilly.com/catalog/9780596101992 "JavaScript: ...

how do i get change to div id to wait until next image is loaded

I am building a website where I need to change the div class that contains image in order to manipulate the style of the next image given it is different in size and needs to be handled differently. I have a manual slideshow system working with an array of images and an array of corresponding class names. The problem is that the javasc...

jquery binding multiple events, and pass data

I know we can have this in 1.4: $("a").bind({ click : clickFn, mouseover: mouseFn }); and that is nice and i would like to use it, but it seems like there is no way to pass extra data to events bound this way, it needs to be done the 'old way': $("a").bind("click", {"some":"data"}, clickFn); Question: how can i pass the extra d...

javascript textbox call event when value changes

I have a textbox, and whenever the value of the box changes, I want to check and see if 20 digits have been entered. I thought that I would use the onChange event, but this seems to be interpreted as the onBlur event on IE. So then I thought I would use onKeyDown, but the problem comes in if the user wants to paste a value into the fie...

Removing DOM event handlers in long-running browser session

I have a browser interface with a ul#contacts list on the left and div#contact property panel (email, phone) on the right. Click a contact in the list and my app makes an XHR request to get the contact property HTML fragment and update div#contact.innerHTML. Each contact fragment has an "Edit Contact" link. With JS, I progressively upg...

Programmatically press "Left" key in a text input

I am trying to programmatically fire a key event to go left in a text box, but not having any luck. The input element has focus and the cursor is at the end. I'm trying to get the cursor to move left one step - before the letter "F" *programmatically by firing a Keyboard event (keydown/keyup/keypress) with the corresponding keystroke ← ...

How to change onmouseover event to onclick instead in javascript?

I am using this plugin in wordpress http://www.iwebix.de/front-slider-wordpress-plugin-demo/ As you can see in the demo above, the left and right arrow buttons are the controls for scrolling the thumbnails and the event is onmouseover and onmouseout. I don't know how to change this to onclick instead so that the thumbnails will scroll...

JavaScript: catching URI change

I have a site where I'm using hash based parameters, eg. http://url.of.site/#param1=123 What I want When the user manually changes the URI to eg. http://url.of.site/#param1=789 When the user enters this URI, the event is caught by the JavaScript, and the appropriate functions are called. Basically, what I'm wondering about is; is ...

Morphing content based on window part focus

What I'm trying to achieve is basically have a code that will morph ( move around the page ) based on the part of the window which is currently viewed. Scenario : - actual page height : 2000px - actual screen height( pc, laptop whatever ) : 800px - 1 image of 600px - 3 div's or virtual boxes ( just to prove what I want to do ) Workflow...

Javascript regex URL matching

I have this so far: chrome.tabs.getSelected(null, function(tab) { var title = tab.title; var btn = '<a href="' + tab.url + '" onclick="save(\'' + title + '\');"> ' + title + '</a>'; if(tab.url.match('/http:\/\/www.mydomain.com\/version.php/i')) { document.getElementById('link').innerHTML = '<p>' + btn + '</p>'...

How to bind events with jquery in django admin when new *Inline is added

I made a jquery function that binds some fields, but it doesn't work when i add a new inline. The main problem is that i don't know how to detect the insertion in DOM and bind it to my function. Thanks ...