javascript

Javascript - Fastest way of copying an array portion into another

I need to copy FAST a portion of an array into another, replacing it's old values. No range checkings needed. Number of items to copy: 16384 The array only contains integers benchmark code: http://codebase.es/test/copytest.htm This is my approach: var i = 0x4000>>5; // loops count var j = 0x4000; // write start index var k...

Can you declare facultative function arguments in Javascript ?

Like you can in php <?php function whatever($var='') { } ?> can you do that in javascript? ...

Getting parserror using Jquery+ASP.Net MVC on Firefox

I've got a simple $.ajax request that I am trying to fetch some HTML content with in my ASP.Net MVC app. // Load the claim table function GetClaimTable() { $.ajax({ type: "GET", url: "claimtable", data: {}, datafilter: null, dataType:'text', succ...

Does iframe runs on the same thread as the owner?

I have a CPU intensive work to do and i don't want to degrade the user experience. since web workers (http://ejohn.org/blog/web-workers/) are a new feature and are not supported by all browsers, i thought to open an iframe with an HTML + JS that will do all the dirty work and using some cross-domain communications to pass on the results....

Having select options in 2 drop down menu lists?

I want to have 2 menu lists and you must select an option from each list then click the next button taking you to another page. Here's a link: http://home.comcast.net/~techjunkee/ ...

Play mp3 files in a webpage without gaps?

I have a web page that I would like to play several mp3's one after the other without gaps when the page is loaded. I have tried a couple of js mp3 player type things (niftyplayer, jsPlayer, flash-mp3-player-js) but all f them have have gaps between tracks. Is there any way to do this, with flash or otherwise? ...

Table row height behavior in IE vs Firefox/Chrome/Safari

Consider the following simple html page markup: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml"&gt; <head> <title></title> <style type="text/css"> body, html { height: 100%; ...

Select Box And Checkbox Replacement

I'm looking for a sensible way how to style select boxes, checkboxes and/or radiobuttons with CSS. I know that you can't do it with plain CSS because of how browsers' rendering engines work. But are there any javascript ways to style these HTML elements? And do they work across major browsers? ...

AIM 7 uses .aba file - need to extract it

Since AIM 7 beta 2, and now onto AIM 7 beta 6, and GM - AIM has started to use a new .aba file format for keeping files in. The files used to be located in a folder that we could access in program files, however due to "performance increasements", AOL has decided to put them in this .aba file instead. The file is not extractable using wi...

Get Daylight Saving Transition Dates For Time Zones in Java

I'd like to know the simplest way, in Java, to get a list of dates in the future where daylight savings time will change. One rather inellegant way to do this would be to simply iterate over a bunch of years' worth of days, testing them against TimeZone.inDaylightTime(). This will work, and I'm not worried about efficiency since this wi...

Binding JQuery events

Hi all. JQuery events are annoying me. The thing is that I very often use javascript (after ajax requests, etc.) to draw up new elements (buttons, divs, etc.). I've got a list of elements which you can press on an edit button so you can manipulate the one linked to the selected edit button. Now if someone submits a form to make a n...

dwr direct call with no parameters

In the code sample below, I am directly using dwr.engine._execute and calling the method. It works fine where we have atleast one input parameter, but with methods like the one below, the method gets triggered and I get the response data but the callback does not fire. Any reasons as to why is this happening? [this is with DWR 3.0] var ...

Create a jQuery special event for content changed

I'm trying to create a jQuery special event that triggers when the content that is bound, changes. My method is checking the content with a setInterval and check if the content has changed from last time. If you have any better method of doing that, let me know. Another problem is that I can't seem to clear the interval. Anyway, what I n...

Lightbox for embeddable JavaScript widget? Like Feedback tabs for UserVoice/GetSatisfaction

There are so many lightboxes to choose from, I'm looking for a very lightweight one to use in an embedded javascript widget that would be used on a number of different web sites. This would work in a similar way to the GetSatisfaction/UserVoice feedback tab. Here are the requirements for the lightbox: Very small javascript download (...

copy text in option tag of a form using javascript?

<select name="products"> <option value=""> - Choose - </option> <option value="01">table</option> <option value="02">chair</option> <option value="03">book</option> <option value="04">car</option> </select> I want to be able to copy text automatically on selecting a particular option... Eg. If I select book, book sh...

More positioning alt text

On this page: http://sparqtraining.com/ The alt text for the thumbnails presents after the onmouseover event in a box underneath all of the pictures. How did they do that? ...

JavaScript - detecting change in a textarea

I'd like the value of two textareas to always be equal. Listening for a 'change' event is not sufficient because I want these fields to be equal even when one has focus. Listening for a keypress doesn't seem to work either as this event is fired before the field's value is updated with the new letter, so I'm not sure if there's a good wa...

how to write your own right click menu and disable the default using jquery/javascript

I successfully disabled the right click event on the page that I am working on using jquery. I want to create a customize right click menu. How can I do this? Does this need relevant css setting to get it working (i.e. "position")? ...

Capturing HTML Text Input Key press after key has been applied?

A total newbie question, so please bear with me here ;) When a key press occurs in a HTML text input control, there are two events that seem useful in managing it (onKeyPress and onChanged). onKeyPress fires after the key has been pressed, but before the operation has been applied to the control's text. The later is only fired when focu...

what is a good method to insert a <img src="..." /> into a <option> </option> in HTML page ?

use javascript or other method ? have any recommendation? ...