Tag: javascript events

jQuery function is not working as i planned, DIVs just disappear on click

I have a script here, and it works amazing, except for one small detail. It basically runs as click function that fades in and out certain DIVs on the click of a link. The problem is, however, that when you click ANYWHERE on the page, it removes the DIV and leaves an empty content area […]

I want to call function on window unload

I am trying to display confirmation box using window.confirm on window unload event, and if user click on OK button on confirmation box then i want to call one function and if user click CANCEL button then window should be get close. My code is : <script> function confirmit(){ var result=window.confirm(“Are you sure?”); if(result) { […]

How to detect browser close event in firefox?

how to detect browser close event in firefox browser.I want to do some clean up process in server side and we maintaining last logout time. To achive this need fire an ajax call when the user clicks logout or the browser is closed. for IE the following code is working, if (window.event.clientY < 0 && […]

D3 mouse release event

I am looking for release event on D3. Actually, my examples has: .on(“mouseover”, function(data){…} ) .on(“mousemove”, function(data){…} ) .on(“mouseout”, function(data){…} ) which works perfect, but. if I try to do something like .on(“release”, function(data){…} ) it doesn’t works. Any idea? Thanks!

jQuery UI – Uncaught TypeError: Object function (a,b){return new e.fn.init(a,b,h)} has no method 'dialog'

I have a problem using jquery ui and dialog() function: Uncaught TypeError: Object function (a,b){return new e.fn.init(a,b,h)} has no method ‘dialog’ I’ve googled around many people with the same problem solved that issue with a correct inclusion of jQuery library. This is the header: http://pastebin.com/e1cTKGK9 And this is the gpf1.js source: http://pastebin.com/0jXhU503

jQuery.unbind deletes wrong handler created using $.proxy

I have JavaScript class: <html> <head> <script src=”MicrosoftAjax.js” type=”text/javascript”></script> <script src=”jquery-1.6.4.min.js” type=”text/javascript”></script> </head> <body> <script type=”text/javascript”> var ClientControl = function () { //some instance-specific code here }; ClientControl.prototype = { initialize: function () { this.documentClickedDelegate = $.proxy(this.documentClicked, this); //this.documentClickedDelegate = Function.createDelegate(this, this.documentClicked); // from MicrosoftAjax }, bind: function() { $(document).bind(“click”, this.documentClickedDelegate); }, unbind: function() { […]

not setting focus to text field in firefox

I faced a very interesting issue. I’m trying to set the focus on a input field using javascript ( no jquery, I tried that also but not worked) using window.onLoad. just take a look at this fiddel : setFocusOnLoad It’s working fine in chrome browser but not in firefox. is there any Issue in firefox. […]

How do you do something if the DOM is changed?

How can I detect when the document changes? I know I could do something like this: var lastHTML = document.body.innerHTML; setInterval(function() { if(document.body.innerHTML != lastHTML) { DOMupdated() } }, 500); But is there an event handler I can put in place, like onchange?

How can I interact with DOM elements under an HTML element that has a background?

I need this fiddle solved. I am unable to interact with DOM elements underneath another HTML element that has a background. This is HTML/CSS 101. However, with backgrounds in combination with rgba and opacity CSS properties, this won’t always be the desired effect. Like in my case, I need the background of an element to […]

how to solve NaN when i deleting number?

This is the code when i am adding in all textbox it works fine but after removing number it shows NaN function sumVal() { var total = 0; var coll = document.getElementsByTagName(“input”) for ( var i = 0; i<coll.length; i++) { var ele = coll[i]; total += parseInt(ele.value); } var Display = document.getElementById(“Display”); Display.innerHTML = […]