javascript

Prototype get by tag function

How do I get an element or elementlist by it's tag name. Take for example that I want all elements from ...

JS library for waterfall graphs

Can anyone recommend a JS library for generating waterfall graphs? There is an example on the Wikipedia page: http://en.wikipedia.org/wiki/Waterfall_chart But, I need the ability to graph it horizontally. ...

How do I select all <th> elements of class "sortasc" within a table with a specific id?

Let's say I have the following HTML: <table id="foo"> <th class="sortasc">Header</th> </table> <table id="bar"> <th class="sortasc">Header</th> </table> I know that I can do the following to get all of the th elements that have class="sortasc" $$('th.sortasc').each() However that gives me the th elements from both table foo an...

How to combine requests for multiple javascript files into one http request?

This concept is a new one for me -- I first came across it at the YUI dependency configurator. Basically, instead of having multiple requests for many files, the files are chained into one http request to cut down on page load time. Anyone know how to implement this on a LAMP stack? (I saw a similar question was asked already, but it se...

Adding an input field to the dom and focusing it in IE

I am trying to make a div, that when you click it turns into an input box, and focuses it. I am using prototype to achieve this. This works in both Chrome and Firefox, but not in IE. IE refuses to focus the newly added input field, even if I set a 1 second timeout. Basically the code works like this: var viewElement = new Element("div"...

IE Javascript Clicking Problem

Hi...first off, I'm working on an app that's written such that some of your typical debugging tools can't be used (or at least I can't figure out how :). Javascript, html, etc are all "cooked" and encoded (I think; I'm a little fuzzy on how the process works) before being deployed, so I can't attach VS 2005 to ie, and firebug lite does...

Including eval / bind values in OnClientClick code

I have a need to open a popup detail window from a gridview (VS 2005 / 2008). What I am trying to do is in the markup for my TemplateColumn have an asp:Button control, sort of like this: <asp:Button ID="btnShowDetails" runat="server" CausesValidation="false" CommandName="Details" Text="Order Details" onClientClick="window.open('...

Can I lookup the IP address of a hostname from javascript?

I would like to use javascript to determine the IP address of a host, as seen from the clients computer. Is it possible? ...

JavaScript Debugger

Does anyone know of a really good editor to debug JavaScript (other then Visual Studio 2008 and FireBug)? ...

Building an HTML table on the fly using JQuery

Below is the code I use to build an HTML table on the fly (using JSON data received from the server) I display an animated pleasewait (.gif) graphic while the data is loading...however, the graphic freezes while the js function is building the table. At first, I was just happy to make this happen (display the table), I guess now I need t...

Why was the arguments.callee.caller property deprecated in JavaScript?

Why was the arguments.callee.caller property deprecated in JavaScript? It was added and then deprecated in JavaScript, but it was omitted altogether by ECMAScript. Some browser (Mozilla, IE) have always supported it and don't have any plans on the map to remove support. Others (Safari, Opera) have adopted support for it, but support o...

What is a javascript hash table implementation that avoids object namespace collisions?

First off: I'm using a rather obscure implementation of javascript embedded as a scripting engine for Adobe InDesign CS3. This implementation sometimes diverges from "standard" javascript, hence my problem. I'm using John Resig's jsdiff library (source here) to compare selections of text between two documents. jsdiff uses vanilla object...

PHP/JS - Create thumbnails on the fly or store as files

For an image hosting web application: For my stored images, is it feasible to create thumbnails on the fly using PHP (or whatever), or should I save 1 or more different sized thumbnails to disk and just load those? Please explain your reasoning. Any help is appreciated, thanks. ...

Localize Strings in Javascript

I'm currently using .resx files to manage my server side resources for .Net. The application that I am dealing with also allows developers to plugin javascript into various event handlers for client side validation, etc.. What is the best way for me to localize my javascript messages and strings? Ideally, I would like to store the str...

xul: open a local html file relative to "myapp.xul" in xul browser

in short: is there any way to find the current directory full path of a xul application? long explanation: I would like to open some html files in a xul browser application. The path to the html files should be set programmatically from the xul application. The html files reside outside the folder of my xul application, but at the same...

Use jQuery to replace my XMLHttpRequest

I am kind of new to JavaScript library's. I wanted to replace my current code with a JS lib jQuery. My current code looks like this. var req; function createRequest(){ var key = document.getElementById("key"); var keypressed = document.getElementById("keypressed"); keypressed.value = key.value; var url = "/My_Se...

Accessing Greasemonkey metadata from within your script?

Is there any way that my script can retrieve metadata values that are declared in its own header? I don't see anything promising in the API, except perhaps GM_getValue(). That would of course involve a special name syntax. I have tried, for example: GM_getValue("@name"). The motivation here is to avoid redundant specification. If GM me...

How to create a GUID / UUID in Javascript?

I'm trying to create globally-unique identifiers in Javascript. I'm not sure what routines are available on all browsers, how "random" and seeded the built-in random number generator is, etc.. The GUID / UUID should be at least 32 characters and should stay in the ASCII range to avoid trouble when passing them around. ...

How can I check to make sure a window is being actively used, and if not alert the end user that they are about to be logged out?

Working on a new back end system for my company, and one of their requests is for a window to become locked down and for the user to be sent to the login screen if they leave it idle for to long. I figure I'd do this with JavaScript by attaching listeners to clicks, mouse moves and keyups but I worry about messing with other scripts. A...

What are some excellent examples of user sign-up forms on the web?

I'm trying to get a sampling of what people think are the best sign-up forms. Good design, usability. Smart engineering. Helpful feedback. Etc. ...