javascript

JavaScript Recurring Appointments Library

I'm looking for a JavaScript library that can calculate recurring appointments. Something that can handle things like "every 2nd Wednesday". The solution needs to be JavaScript and client side only. I don't need a calendar, just something that can do the date recurring appointment calculations. Any suggestions? ...

simplest way to write programs in javascript on desktop?

I'm looking for way to write Javascript programs / scripts on desktop, not inside browser. I want it to run like Python - from the command line, to be able to read files, write files etc. All solutions I find mentioned (Rhino, spidermonkey, V8) are for embedding. Has anyone done simple implementation for just writing standalone programs ...

Click and Drag element from one div to another jquery-ui

I have one div that contains a bunch of draggable div objects. This main container is called "floater" and will scroll down the screen in relation to mouse scroll. I also have a div called validtargets, which is populated with a table providing a grid appearance in the background. The draggable objects are given the snap: 'td' tag so ...

Cross-Browser Method to Determine Vertical Scroll Percentage in Javascript

How can I find out what percentage of the vertical scrollbar a user has moved through at any given point? It's easy enough to trap the 'onscroll' event to fire when the user scrolls down the page, but how do I find out within that event how far they have scrolled? In this case, the percentage particularly is what's important. I'm not ...

JQuery MouseOut Event Problem

Hello, I am trying to create a menu panel in jquery, all is complete except for one problem. When I hover over a link, it shows a black panel, i want to be able to hide that panel only when mouse is out of that black panel area. Currently it fades out even if i am inside that black box. Here is the script you can see the preview of by ...

Javascript Date difference bug ?

Edit: It's not a bug as Martin pointed out. I'm just crossing the daylight saving time, hence the 1h difference. I want to calculate the difference in days between "Mar 29 2010" and "Mar 09 2010" so i have the following code: ((new Date(2010, 2, 29)).getTime() - (new Date(2010, 2, 8)).getTime()) / 86400000 86400000 is the number of m...

Ajax response is gzip compressed - Prototype, Firefox can't handle it

I'm trying to query a webservice (with javascript, prototype). The server responds with XML, but compresses it; headers are set appropriately. Under Safari 4, everything is fine. The response is decompressed and Javascript can deal with the data. Under FireFox 3.5.8, no data is returned to Javascript! Code: var req = new Ajax.Re...

Best way to take data and throw it in a graph?

I want to take data from a table that'll be almost exactly similiar to the one below, but have it in a line graph. The date values would be on the Y-axis, and it would plot the XP values on the X-axis. Since the numbers for each user vary, I'd need a way to make the distance between each point plotted "relative", I guess. Any suggesti...

Using javascript with DITA

Hi All, How to use javascript with DITA ? •We can give 'javascript:URL' to the 'href' attribute of <xref>,<link> and <lq> elements and it will execute it properly. ■ e.g.<xref href="javascript:alert('Hello World');">Click here to get alert box</xref> •We tried to execute javascript user defined functions from href attribute but bu...

jQuery fadeOut() and slideUp() at the same time?

I have found http://stackoverflow.com/questions/734554/jquery-fadeout-then-slideup and it's good, but it's not the one. How can I fadeOut() and slideUp() at the same time? I tried two separate setTimeout() calls with the same delay but the slideUp() happened as soon as the page loaded. Has anyone done this? Thanks ...

jquery 'attribute contains' selector with a dynamic value

Let's say that i have a variable questionId which is an integer, and i want to find tr elements that have the fragment ("question_"+questionId) in their id. How can i do this? I thought that i would be able to do it with the jquery 'attribute contains' selector. Eg, this works, for a non-dynamic value, $("tr[id*='quiz_question_7674...

node.js on multi-core machines

node.js looks interesting BUT... I must miss something - isn't node.js tuned only to run on a single process & thread? Then how does it scale for multi-core CPUs and multi-CPU servers? After all, it is all great to make fast as possible single-thread server, but for high loads I would want to use several CPUs. And the same goes for maki...

Is there any jquery version of IE7.js available?

I need jquery version of IE7.js or any other similar jquery based js for same thing? http://code.google.com/p/ie7-js/ ...

How does it work? - Javascript function to make non-IE fixes using YUI

Here's the code I'm trying to understand: noniefix.js: function fixNonIE() { if(YAHOO.env.ua.ie > 0) { return false; } var divs = YAHOO.util.Dom.get('bd').getElementsByTagName('div'); if(divs.length > 0) { YAHOO.util.Dom.batch(divs, pushup); alert (divs.length+" divs in file!"); } } function pushup(el) { if(el.id.search('f...

Get Locale Short Date Format using javascript

Is there anyway we can know using JavaScript the Short Date Format used in the Control Panel -> Regional and Language Settings? I know the using the combination of following we can get the Locale Long Name format toString() toLocaleString() toLocaleDateString() toLocaleTimeString() But there is no direct function in JavaScript like t...

Could you recommend me a server-side javascript parser?

I have to extract defined variable and function names from a js code passed as a text. Example: $js_code = " var MyVar1 = 'val1'; \n var MyVar2 = 'val2' ; \n function MyFunc() { some code }"; Extracted: $js_vars = array("MyVar1", "MyVar2"); $js_func = array("MyFunc"); ...

Is it possible to enumerate the field names of an ADO Recordset with JavaScript and cscript?

I am writing some scripts to run on old Windows NT machines. I am planning on using the command-based script host (cscript) to execute them. The script are querying some SQL data and I want to retrieve the field names from the RecordSet, but it doesn't seem to work. This is the code I'm using: rs.open(query, conn, adOpenForwardOnly, ad...

Drupal Dynamic Select on a Form

I'm sure this is an easy one for jQuery experts, but I'm a backend guy, and can't find the best way to do this. I have two arrays in Drupal, one is a list of names of views, and the other is an array that contains a list of displays for each view. Here's the code to populate the two arrays: //load list of views in to array for select...

Open page on the same tab after submission?

I have this code: function submitTwice(f){ f.action = 'http://mydomain.com/threevideopage.php'; f.target='name'; f.submit(); } I left out the form code. What it does is display the name of the visitor after submission. It works great. But I would like to open it in the current tab, not on another tab. How would I do it? I...

HTML 5 and Javascript's Role?

Anyone clear on how big a role Javascript will play when HTML 5 comes around? I'm deciding now whether to purchase a book on Javascript DOM or learn something useful like cooking with hemp oil. I'm already weary of the past year and a half I've spent absorbing AS3. I love it, I just don't want to be outmoded in 5 years when the iRevol...