javascript

Animation in javascript, a starting point

I understand how JS is run and I think I understand most of the DOM but I've no idea about animation. Does anybody here know of a good guide that can explain to me how it's done in Javascript? In addition, should I even consider Javascript for animation? Should I instead be looking to learn flash? ...

style.display not working in Firefox, Opera, Safari - IE7 OK

I have an absolutely positioned div that I want to show when the user clicks a link. The onclick of the link calls a js function that sets the display of the div to block (also tried: "", inline, table-cell, inline-table, etc). This works great in IE7, not at all in every other browser I've tried (FF2, FF3, Opera 9.5, Safari). I've trie...

Getting selected text in a browser, cross-platform.

One of the things I'd like to do in my browser-based application is allow the user to select some text (not in a <textarea>, just plain ol' text!), and have my application pop up a small toolbar that then can interact with the next (in my case, add annotations). I've found a lot of stuff on google that seems to be focused on writing WYS...

Best resources to learn JavaScript

The question says it all really, I'm looking for book recommendations, video tutorials etc. I've been programming since I was about six so I don't need a book that spends 4 pages on for loops (thought that might be a Bad example in terms of javascript). Also I'm learning ASP.net at the moment so anything on interoperability features/iss...

How do I add a pre tag inside a code tag with jQuery?

I'm trying to use jQuery to format code blocks, specifically to add a <pre> tag inside the <code> tag: $(document).ready(function() { $("code").wrapInner("<pre></pre>"); }); Firefox applies the formatting correctly, but IE puts the entire code block on one line. If I add an alert alert($("code").html()); I see that IE has inserte...

Is there a "concise" way to do namespacing in JavaScript?

I've frequently encountered sites that put all of their javascript inside a "namespace" structure along the lines of namespaces = { com : { example: { example.com's data} } But setting this up safely with respect to other namespaced frameworks seems to require a relatively hefty amount of code (defined as > 2 lines). I was wondering ...

Scrolling Overflowed DIVs with JavaScript

I've got a div that uses overflow:auto to keep the contents inside the div as it is resized and dragged around the page. I'm using some ajax to retrieve lines of text from the server, then append them to the end of the div, so the content is growing downwards. Every time this happens, I'd like to use JS to scroll the div to the bottom so...

How do I remove a child node in HTML using JavaScript?

Is there some function like: document.getElementById("FirstDiv").clear() ? ...

Executing JavaScript to Render HTML for Server-Side Caching

There are lots of widgets provided by sites that are effectively bits of JavaScript that generate HTML through DOM manipulation or document.write(). Rather than slow the browser down even more with additional requests and trust yet another provider to be fast, reliable and not change the widget output, I want to execute* the JavaScript t...

Building Standalone Applications in JavaScript

With the increased power of JavaScript frameworks like YUI, JQuery, and Prototype, and debugging tools like Firebug, doing an application entirely in browser-side JavaScript looks like a great way to make simple applications like puzzle games and specialized calculators. Is there any downside to this other than exposing your source code...

What do the getUTC* methods on the date object do?

What does it mean when you get or create a date in UTC format in JavaScript? ...

Best practices for managing and deploying large javascript apps

What are some standard practices for managing a medium-large javascript app? My concerns are both speed for browser download and ease and maintainability of development. Our JS is roughly "namespaced" eg: var Client = { var1: '', var2: '', accounts: { /* 100's of functions and variables */ }, orders: { /* 1...

Is there anyway to disable the client-side validation for dojo date text box?

In my example below I'm using a dijit.form.DateTextBox. <input type="text" name="startDate" dojoType="dijit.form.DateTextBox" constraints="{datePattern:'MM/dd/yyyy'}" value='<c:out value="${sessionScope.adminMessageForm.startDate}"/>' /> So for example, if the user starts to enter "asdf" into the date the field turns yellow and a pop...

Looking for a specific FireFox extension / program for Form posting

I am looking for either a FireFox extension, or a similar program, that allows you to craft GET and POST requests. The user would put in a form action, and as many form key/value pairs as desired. It would also send any cookie information (or send the current cookies from any domain the user chooses.) The Web Developer add-on is almost w...

Web App - Dashboard Type GUI - Interface

I'm looking to create a dashboard type gui for a web application. I'm looking for the user to be able to drag and drop different elements (probably either image buttons, anchor tags, or maybe just divs) to different (defined) places and be able to save their setup (in a cookie or on the server). I'm working with c# in the .Net 2.0 fram...

Dynamic Alphabetical Navigation

I'm using ColdFusion to return a result set from a SQL database and turn it into a list. I need some way to generate an Alphabetical Navigation bar for that list. I have ColdFusion and the jQuery library available. I'm looking to generate something like this: A | B | C | ... A A B B B C D Where clicking on one of the letters ...

Communication between Javascript and the server

I've been developing a "Form Builder" in Javascript, and coming up to the part where I'll be sending the spec for the form back to the server to be stored. The builder maintains an internal data structure that represents the fields, label, options (for select/checkbox/radio), mandatory status, and the general sorting order of the fields....

Google Maps API - Problems with class GLatLngBounds

I am having some trouble with the Google Maps API. I have an array which holds a ojbect I created to store points. My array and class: var tPoints = []; function tPoint(name) { var id = name; var points = []; var pointsCount = 0; ... this.getHeadPoint = function() { return points[pointsCount-...

What's the best way to code a desktop application-like menu bar in Javascript?

I'm looking to create a menu bar similar to those found in desktop applications using xhtml and javascript. I don't mind using a framework like jQuery (in fact I'm already using jQuery for other behaviour in the app), but I'd like to avoid using a plugin or an external js solution (the idea is to keep it as light and as tightly-controll...

Will server-side JavaScript take off? Which implementation is most stable?

Does anyone see server-side JavaScript taking off? There are a couple of implementations out there, but it all seems to be a bit of a stretch (as in, "doing it BECAUSE WE CAN" type of attitude). I'm curious to know if anyone actually writes JavaScript for the server-side and what their experiences with it have been to date. Also, whic...