javascript

JavaScript bulleted list generation

I'm using Rails 2.2, and as well as standard JavaScript libraries, we jQuery also. Given that, can anyone advise me of a starting point in creating a UI component which would allow users to create a bulleted list, adding bullets/deleting bullets/indenting sub-bullets etc? I'm not bound to using the libraries we already have, but conside...

jQuery, hover method and closure

Have been struggling with Javascript closure for a while trying to wrap brain around function scopes, but I think they're wrapping around me instead. I've looked at a number of posts (Nyman's was the most helpful) but obviously still don't get it. Trying to run a loop over the hover method in jQuery. Need hover functions to ultimate trig...

Looking for examples of simple web-based form designers...

I have a requirement to implement a "simple" web-based form designer that allows "simple" users to create their own web-based forms. I've come across these things in rich clients, such as Outlook and Acrobat, but my requirements are much simpler and must be web-based. Pretty layout, custom validation, complex fields and types are simpl...

How can I use JavaScript within an Excel macro?

There’s a really cool diff class hosted by Google here: http://code.google.com/p/google-diff-match-patch/ I’ve used it before on a few web sites, but now I need to use it within an Excel macro to compare text between two cells. However, it is only available in JavaScript, Python, Java, and C++, not VBA. My users are limited to Excel ...

How efficient is javascript?

Sometimes I hear the argument against doing things on client side using javascript. People say stuff like "JavaScript is inefficient...or slow". I'm wondering if there actual facts supporting this conclusion? ...

jQuery Filtering

Is there a way to filter a multi-line select box using jQuery? I'm a new to jQuery and can't seem to figure out the best way to do this. For example if I have: <select size="10"> <option>abc</option> <option>acb</option> <option>a</option> <option>bca</option> <option>bac</option> <option>cab</option> <option>cba...

Dragged div change places with destination

Hi. Maybe a bit complex to explain. I have a grid with 9 images 100 x 100 px like this (each number symbolize a picture): 1 2 3 4 5 6 7 8 9 What I want is that the user can drag and drop e.g. 9 over 1 and they change places like this: 9 2 3 4 5 6 7 8 1 Sortables from jquery UI will not work since their solution is using floats. Th...

issue with parsing JSON string

I have this object which I use as a list of objects: var objList = new Object(); This is then serialized using JSON serialize. If there are no object added or all objects have been removed from the list and the blank objList is serialized, parsing the objList using JSON parser in IE, it will occasionally fail to evaluate the objList a...

Javascript graphing library to draw a region

As a keen windsurfer, I'm interested in how windy the next few weeks are going to be. To that end, I've been writing a little app to scrape a popular weather site (personal use only - not relaying the information or anything) and collate the data into a single graph so that I can easily see when's going to be worth heading out. I have t...

What is the JavaScript equivalent of C# Server.URLEncode?

What is the JavaScript equivalent of C# Server.URLEncode? ...

Locale-aware JavaScript validation

Can you suggest a locale-aware way to validate a currency value on the client using Javascript? Obvious issue to consider: 1,234.56 in the US and UK is the same as 1.234,56 in most of Europe Sri ...

JavaScript to Save As with current date

I have a time sheet form named Timesheet Paperless.pdf I send this form to an employee and tell them to fill their name and employee number in the form. I then ask them to go to File>Save As and name the form INTIALS_TS.pdf . I now would like to a have button with in the form that will open a Save As dialog with the filename INITIALS_TS ...

JavaScript to Flash and Back?

I am completely new to flash. We need to load a binary file from the user system (must work in Flash 9) and do some process in flash and save it back to the file system. I think that this would have to be done by getting the file in JavaScript and then encoding it send it to Flash. ...

Using javascript for pinging a webapp to keep session open

I'm writing a greasemonkey script to keep session open on a webapp I use for work. Which javascript command would you use to create some feedback with the server and ensure the session doesn't fall without having to bother the user making a complete refresh of the page? ...

jumping into javascript?

Duplicate: Which JavaScript framework is best for web development? JavaScript Debugger others... and still more... I want to learn javascript but first it would be nice to know the best tools out there. Like what's the best frame work, debugger, method for debugging? thanks in advance. ...

Javascript breaking Firefox?

About 5 times over the past 6 months, in complex javascripts, I'll get an error in firefox only (IE6, 7, 8, Chrome, Safari, Opera are all fine) whereby nothing in my javascript happens. There will be no messages in the error console, and according to Firebug, all my scripts are totally blank. Force reloading and clearing the cache does ...

Handling no results in jquery autocomplete

Hey I'm trying to return a message when there are no results for the users current query! i know i need to tap into the keyup event, but it looks like the plugin is using it ...

Get un-translated, un-rotated (x,y) coordinate of a point from a Javascript canvas

In Javascript we often render graphics by rotating and translating the coordinate plane before sending things ctx.save(); ctx.translate(someX, someY); ctx.rotate(someAngle * Math.PI / 180); ctx.beginPath(); ctx.moveTo(x1, y1); // What's the actual (x1,y1)? ctx.lineTo(x2, y2); // What's the actual (x2,y2)? ctx.stroke(); ctx.resto...

Xml, xsl Javascript sorting

Hi guys, I am looking for a way to sort my xml data with javascript, and want to eventually filter out the data as well. I know all this is possible in the xsl file but i would like to do it client side. I have searched multiple places for sorting with javascript but most of it was either too xml file specific or I couldn't figure out...

Trying to replace html tags using regex

For the example, I'm trying to replace <script type='text/javascript'>some stuff</script> with: <div type='text/javascript'>some stuff</div> I'm currently testing with: alert( o.replace( /(?:<\s*\/?\s*)(script)(?:\s*([^>]*)?\s*>)/gi ,'div') ); But what I'm getting is: divsomestuffdiv How can I get this to only replace the "sc...