javascript

Editing an XML file with JavaScript?

Hey guys, I'm just learning JavaScript and I have a question I hope someone can answer. Is it possible to get an XML file (not HTML) from a server, add/remove/edit particular parts of it with client-side JavaScript, and then send it back to the server to save it? JSON or any other markup/data interchange format works too. ...

How do you make a flash movie to play full screen mode using javascript?

I have a .swf file I am including in my html document. I'd like to be able to play it in full screen mode. (No browser showing). Is it possible to do this using html / javascript or is this a component of the flash movie itself? ...

javascript : find page url with a function in my frame

I have made a html page and two website take it on her website like a frame. I want to change the color of my frame. So i have to know witch website included my frame. What function I have to use in javascript Thanks ...

How to detect timeout on an AJAX (XmlHttpRequest) call in the browser?

Hi everyone, I'm looking on the web, but documentation is hard to come by. We all know the basic AJAX call using the browser's built-in XMLHttpRequest object (assume a modern browser here): var xmlHttp = new XMLHttpRequest(); // Assumes native object xmlHttp.open("GET", "http://www.example.com", false); xmlHttp.send("");...

How do you remove a breakpoint from Safari 4's Javascript debugger?

How do you remove a breakpoint from Safari 4's Javascript debugger? ...

How to dynamically reconfigure Drupal's jQuery-based autocomplete at runtime?

Drupal has a very well-architected, jQuery-based autocomplete.js. Usually, you don't have to bother with it, since it's configuration and execution is handled by the Drupal form API. Now, I need a way to reconfigure it at runtime (with JavaScript, that is). I have a standard drop down select box with a text field next to it, and dependi...

How to Set OnClick attribute with value containing function in ie8?

My goal is to change the "onclick" attribute of a link. I can do it successfully, but the resulting link doesn't work in ie8. It does work in ff3. For example, this works in firefox3, but not ie8. Why??? <p><a id="bar" href="#" onclick="temp()">click me</a></p> <script> doit = function(){ alert('hello world!'); } ...

jQuery event delegation with non-trivial HTML markup?

Hello, I have two DIVs, first one has a link in it that contains the id of the second DIV in its HREF attribute (complete setup on jsbin). I want to animate the second DIV when user clicks on the first - anywhere on the first. I also want to use event delegation because I'll have many such "DIV couples" on a page (and I'm using a JS s...

JavaScript - Test for an integer

Hello, I have a text field that allows a user to enter their age. I am trying to do some client-side validation on this field with JavaScript. I have server-side validation already in place. However, I cannot seem to verify that the user enters an actual integer. I am currently trying the following code: function IsValidAge(value) ...

How can I know if an DOM element is currently on screen using jQuery.

Is there a function, or plugin, that tells me if more than 50% of a <div> block is currently being displayed? I know there are things like $.offset() but I didn't want to do it by hand every time the user resizes it's window or scroll to a region. Something on the lines of :visible, but that is currently visible. Thanks! ...

jquery drag image

i want to make a draggable image in jquery. first of all my experience with jquery is 0. having said that let me describe what i want to achieve. i have fixed width/height div. and the image contained inside the div is large in size. so i want the image to be draggable inside that div so that the user can see the entire image. can some...

javascript fade animations

i want a certain DOM element to fade into view in my script. i tried using the timeout feature but couldnt get it to work. hover.addEventListener('mouseover',function () {Core.addClass(cpanel,"on");},false); please tell me how to implement a fade-in effect for this. please dont recommend jquery or any other framework. ...

Convert Lat/Longs to X/Y Co-ordinates

I have the Lat/Long value of New York City, NY; 40.7560540,-73.9869510 and a flat image of the earth, 1000px × 446px. I would like to be able to convert, using Javascript, the Lat/Long to an X,Y coordinate where the point would reflect the location. So the X,Y coordinate form the Top-Left corner of the image would be; 289, 111 Things ...

Put a Firefox window in full screen mode

I've projected an Intranet Ajax application and I want put it in a full screen mode so it seems as a real stand alone application. My problem is that with Firefox 3 the window.open with options to put the window in full screen mode not work well. I have always the tile bar the url bar and the status bar. Is there a way to hide that bar...

Are javascript objects kept across pages?

I was wondering whether the javascript objects kept accross pages? Looks like some browsers do and some dont. What is the standard behavior? Thanks, Ebe ...

Retrieving a csv file from web page

I would like to save a csv file from a web page. However, the link on the page does not lead directly to the file, but it calls some kind of javascript, which leads to the opening of the file. In other words, there is no explicit url address for the file i want to download or at least I don't know what it should be. I found a way to do...

How to hide or encrypt javascript code?

Is it possible at all? Thanks! ...

(Ruby,Rails,Javascript) Redirecting/Rendering a different page when Javascript is disabled...?

Hi All, I'm having severe issues with Rails, Javascript, and redirects. Basically I have the "simple" issue of redirecting to a different page if JS is disabled. If JS is enabled, then I add a new item inline immediately -- this works like a charm. However, if JS is disabled I want to redirect to the NEW page of a different controlle...

Which JavaScript libraries have event delegation?

I'd like to try out a new JavaScript library. Having used (and loved) jQuery 1.3's "Live" events, I'd prefer the next library I try to have event delegation built in to the event system. Wikipedia's JS Library Comparison falls down on the job here. Looks like MooTools is getting it in 2.0. What about the others? I'm making this communi...

How to make flash movie to scale proportunatly to div width?

I have put together an example page detailing my problem My website is going to have a main wrapper that is set to a max-width property for compatible browsers. It will stretch to 940px across at max. When scaled down I would like the swf to scale proportionately with it. Like an image with width percent applied. The flash movie has the...