javascript-events

javascript How to trigger native click action (replay event) later?

I'm using jQuery to bind to all links on the page (I'm using the 'click' event, but have tried various combinations of 'mousedown' and 'mouseup',together with bind() and live() to no avail). I can intercept the click no problem (with all the above methods). What I am trying to do is send some data via a GET request, and when it complete...

jQuery wResize - resizing IE windows

Hi, I have encountered a problem with re-sizing IE windows. I have considered using a timeout event, but this isn't good enough because time may vary from one re-size to another and I'm not interested to setting a time-out to 5+ seconds. Are you aware of any alternatives to wResize jquery plugin? THank you ...

Google Maps API integration - Click function for map markers, causing headache

Hello, So, as the title suggests I am 'trying' to get the markers on my Google Maps to activate and display some information when clicked. Problem is that somewhere along the way my markers have disappeared (or at least aren't being plotted) and I'm getting some weird warnings about code coming from Google when I examine for breakpoint...

How would I stop a live jquery event handler from firing more than once?

Greetings. I'm trying to post-process content that is added to the DOM via the excellent SyntaxHighlighter project. When SH formats text, it generates a bunch of HTML and then writes that HTML into the DOM. It creates a div with class "syntaxhighlighter". I want to listen for the insertion of these new divs, and when they are inserted...

How to trace Javascript events (Stack Trace ) ?

Hi, In any programming langauge , I can trace any function and know witch function is called by other . but in Javascript , I don't know how ? since the code is not written by me and Firebug does not give this feature - as I know . An example : I want to display the function names of each function that is called when clicking on XYZ E...

SetInterval not works fine in chrome browsers

It's works fine for only 5 min in chrome then the page doesn't respond am i miss anything . This is my code.It works fine in FF and IE8 Browsers function do(){ // coding setTimeout(do,30000); if(navigator.userAgent.toLowerCase().indexOf('chrome') > -1){ setInterval(do,20000); } }...

strange javascript problem

I see a developer using this in my site window.setTimeout("pg.init()", 10); problem is that when I click once on the record set it works fine. However when I click on the record right away all I get is the hour glass. However if I wait and then click, it works again..what could be wrong. Any suggestions? thanks ...

Capturing onkeydown in Javascript

I have a web front-end to an AS/400 CGI application which allows the use of some of the F1-F24 keys (depending on the page) as well as page-up, page-down etc - these are passed to the underlying application which handles them appropriately. For instance, on a given page, a user could either press the F3 button or press the F3 key - both ...

Observer Field: Autofill field when selecting another field...

Here's my existing code: <% form_for(@match) do |f| %> <%= f.error_messages %> <fieldset> <p> <label>Name</label> <%= f.text_field(:name) %> </p> <p> <label>OR email address</label> <%= f.text_field(:email) %> </p> </fieldset> <p> <la...

Only fire one click event when polyline is clicked in Google Maps (v3)

For Google Maps V3, I have some code that created a marker when a polyline was clicked. I also have some code that creates a marker when the map is clicked. Earlier today, when I clicked on the polyline, only one marker was created (I'm guessing it didn't fire a map-click event). Now tonight, I have not changed my code at all, and it ...

Adding keylistener and using javascript to click a link in Greasemonkey

Hi , I want to create a greasy monkey script , which will add a shortcut key for logout action in one mail site. Currently the logout link "?logout&hl=en" which have an id=":r5". I am able to get the node for the link but not able to call click on it. I tried the script as following function key_event(event){ GM_log("Hello"); ...

image.Onload does not complete the image.

This is driving me crazy. I need to load an array of images in Javascript, but I want to make sure that all the images are loaded before starting drawing them. So, I busy-wait for every image onLoad event to be called. First I create images and set their source and onload function: // Load images from names for (i = 0; i < this.nImages...

DropDownList not firing onbeforeunload when AutoPostBack="True"

I have implemented an "unsaved changes" warning using techniques described on these pages: http://stackoverflow.com/questions/140460 http://kenbrowning.blogspot.com/2009/01/using-jquery-to-standardize.html This works well except for a DropDownList on the page. It does an AutoPostBack, and I want onbeforeunload to fire because unsaved ...

Get Tree Node name

I have a ASP.Net TreeView Control with Checkboxes along Child nodes. I want to get Text of the checked Child Node in the TreeView control. And I want to get the checked Child Node Text using jQuery/javascript. Mostly I had used jQuery in the page I had done. I had used $(this).text(). But its not working. Since the control is ASP.Net Tr...

Detecting when there is a response on an iframe?

I have created an AJAX style file download (using an iframe) and all works well... however, I need to detect when the iframe has received a response... see below: Javascript: function download() { var ifrm = $('#iframedownload')[0]; ifrm.src = '/downloadfile.aspx?fileid=whatever'; ifrm.onreadystatechange = function () { // Checki...

JavaScript KeyUp in All Of My Form (For Example Enter Key)-> Show An Alert

Hi my dear friends: I know how can we use onkeyup event of an element... but I want to have an alert in all of my form areas when a client presses the enter key(for example) (not on an unique element) Is there a function that already exists in javascript to do this? Should I create a function to do this? Or should i put alert code (wit...

Detect when cursor leaves page

Hi I want to be able to know when the users cursor leaves the body of my html page. I am using the following script which uses the onmouseout event of the document/window to determine this. This works fine if there is absolutely nothing on the page, but if there is even some text it doesnt work properly (if the mouse goes over the text...

How to prevent AutoPostBack when DropDownlist is selected using jQuery

I want to show a confirm dialog when the user selects an item in a DropDownList. If the user presses "Cancel", I want to stop the postback. Here is the function I add to the onchange event: function imitateConfirmUnload(event) { if (window.onbeforeunload = null) return true; return confirm("Are you sure you want to navi...

Triggering swipe and touch events on a mobile web app? - iPhone/Android

Hi folks, wondering here if there is a way I could trigger an event, so that any library listening for these events (e.g. jQTouch, Sencha touch, iUI, ... ). If I could extend or use jQuery for such task e.g. $(...).trigger('event') that would be great to know. Usage example: I need to debug a few web apps by simulating multi touch ...

how to get the previous page URL in IE using javascript where the condition is history.back shouldn't be used?

how to get the previous page URL in IE using javascript where the condition is history.back shouldn't be used & REFERRER is not working. ...