javascript

How do I warn a user before closing a page when textarea is not empty?

I'm trying to replicate the same thing as on the stackoverflow textareas. EDIT: I went with something like this, after reading the suggestions here: window.onbeforeunload = function() { var myTextArea = document.getElementById('post_content'); if (myTextArea.value.length > 0) { return "You haven\'t submitted your pos...

JS: Is that possible to show empty browser status line, for each event on the page

Hi! I have an application that send very big quantity of requests to the server (they appears after the page is loaded, and made from flash app) This happens so often that status line go mad (displaying: Transferring data text every few seconds), and it's really annoying. I that possible to handle all events on the page, and don't allo...

ajax postback in jquery

i'm having a ajax request on the page. is their any way to find when a ajax is requested on the page. in jquery or javascript to find or initiate a function whn ajax request is called in a page. ...

HELP! Frameset Tag with Dojo use Memory Leak in IE7

Hi,there I develop the Web application with "dojo 1.3.1" now. The application uses frameset tag for a layout. the fram parts in "menu domain" and "the contents domain". When I chose a menu,"the contents domain" displays pages. "memory leak" happened, when I update screen by pushing the update button (F5Key) or when I choosing a page f...

Keeping track of loaded scripts per page using ViewData

Hi all, I'm currently trying to find a good way to load my javascript files only when I need them. In order to do this, I created several HtmlHelpers for faceboxlinks, datepickerfields, tinymcefields and other scripts that need an external js and an initialisation jquery expression. In these helpers I execute the script using jQuery's g...

Add a marker to an image in javascript?

Hi, Anyone know how I can add a marker to an image (not a map) in Javascript? Ideally I'd like a handler that behaves much like adding a marker to a map - i.e. onclick causes a marker to be displayed at the point that was clicked, and returns the x/y pixel coordinates of the point that was clicked. Is this possible? Cheers Richard ...

Print using javascript for more than 1 printers

Hi all I want to print 2 kind of documents on 2 different printers. I use "Always print silent" on firefox so the print window doesn't show up on every print. But now I want 2 different prints I can not use this option and I really don't want the print window to show up. Any idea how I can do this like changing the default printer using ...

javascript date object :Error while using addDays function

I was trying to execute the below code in my javascript and got some exception var now3 = new Date(); now3.addDays(-4); Error throwed is Microsoft JScript runtime error: Object doesn't support this property or method I m using jQuery 1.3.2 in my page . Whats wrong with this? Please help ...

Does JQueries Live Work in IE8?

Hello all, I am making use of the JQuery fancy box - in this pop up box I have a form with a few select fields and upon changing these slect fields a value in a span element should change. I have got this to work (actually with stackoverflow users help) but the solution doesn't work in IE8...suprise...suprise. I make changes to the sel...

Calculate lat/lng of corners of ground overlay from kml-file

I need to find the corners in lat/lng of a ground overlay given in a kml-file either in php or javascript. I.e. for a specific example I need to get from: <LatLonBox> <north>60.406505416667</north> <south>60.400570555556</south> <east>5.3351572222222</east> <west>5.3190577777778</west> <rotation>3.7088732260919</r...

Is "Jint - Javascript Interpreter for .NET" reliable?

I've seen jint in Codeplex. It looks very interesting. Have you used it? Is 0.8.4 stable and usable in your opinion? (production quality?) ...

Detecting Drop Event in Input (Text) using Javascript

Hi all, Atleast defining my problem is simple... I have a Input control (Text) and a javascript function, which truncates the Text in the input control to 15 characters. ie if the length exceeds the limit, left(text,15) is set back to the control. This is handled through onkeyup event... Now, when user drag and drops the text direc...

call a javascript from a flash?

Possible Duplicate: How do you trigger javascript functions from flash? Possible Duplicate: How do you trigger javascript functions from flash? Can flash call a javascript? For example a Button in a flash will call a function ($("div.boxclose").addClass("boxopen").show("slow");) from jQuery library. Is that possible? T...

Javascript to set div height not working

Hi, im trying to set the height of two divs on my page, because my page content is dynamic. But it wont work. The height is just one screen of the divs. The divs contain side borders, thats why it has to be all the way. Any ideas why the height only = one screen height? function bodyHeight() { var scnHei; if (self.innerHeight)...

Javascript: know when an object will be garbaged

Hi all, is there a way to know when an object will be disposed by GC? My object (call it A) write some variables in a global array-object, so when the object will be garbaged its own variable will stay in the global array-object, taking up memory. ps. i have numerous objects A and i prefer to not call "manually" a method to free my glo...

Does jQuery Live work on Safari?

Hello all, I have just asked this question an hour ago but with regards to IE8 and I was told that the JQuery Live handlers does not support "change" so I switched over to "click", this solved my problem and now I find Safari does not work with click for some strange reason, anyone know why? So I was thinking can I just have both? $('...

XPath expression exception

Hi I am not really sure if i am doing this right with XPath expression. I am trying to locate a text on DOM and this text is assingned to a variable. I have text stored in SQLite and i have retrievd the text and i am trying to locate it on the webpage which actually contains the text. so i ahve the following code: var searchText = dat...

Print content of JavaScript object?

Typically if we just use alert(object) it will be show as "element object". How to print all the content parameters of an object in JavaScript? ...

Performance Differences in XMLHTTPRequest in Firefox and Opera 10

Are there any fundamental differences in the way Firefox 3.5 and Opera 10.0 implement the XMLHTTPRquest Objects? After implementing a asmx web service which performs transformations given (well-formed) XML and xsl, I have found that Firefox response times are extremely slow (i.e. +2s) compared to Opera 10 (-1s). I would assume this laten...

JQuery - Appended Links don't work

I have created a dynamic list picker script using Jquery 1.3 and PHP that sends a JSON AJAX request and returns a list of items to choose from. The AJAX call works perfectly returning an array of items that I use Jquery to append them as an unordered list to an empty container DIV. That portion of the process works as expected. The pro...