jquery

Show Only One Element with JQuery

I need to show only one element at a time when a link is clicked on. Right now i'm cheating by hiding everything again and then toggling the element clicked on. This works, unless i want EVERYTHING to disappear again. Short of adding a "Hide All" button/link what can i do? I would like to be able to click on the link again, and hide it's...

How to render contextual difference between two timestamps in JavaScript?

Let's say I've got two strings in JavaScript: var date1 = '2008-10-03T20:24Z' var date2 = '2008-10-04T12:24Z' How would I come to a result like so: '4 weeks ago' or 'in about 15 minutes' (should support past and future). There are solutions out there for the past diffs, but I've yet to find one with support for future time diff...

Stop jQuery .load response from being cached

I have the following code making a GET request on a URL: $('#searchButton').click(function() { $('#inquiry').load('/portal/?f=searchBilling&pid=' + $('#query').val()); }); But the returned result is not always reflected. For example, I made a change in the response that spit out a stack trace but the stack trace did no...

Should I convert from MooTools to jQuery?

I have a fairly large codebase that depends on MooTools v1.11 and am about to convert to version 1.2. Since this is a pretty major overhaul, I've toyed with the idea of converting to jQuery. Anyone have advice on whether to update to jQuery or just stick with MooTools? I mostly use MooTools for Ajax, drag and drop, and some minor ef...

Obtain form input fields using jQuery?

I have a form with many input fields. When I catch the submit form event with jQuery, is it possible to get all the input fields of that form in an associative array? ...

In Flot, is it possible to eliminate or hide grid ticks without eliminating the corresponding label?

The Flot API documentation describes the library's extensive hooks for customizing the axes of a graph. You can set the number of ticks, their color, etc. separately for each axis. However, I can not figure out how to prevent Flot from drawing the vertical grid lines without also removing the x-axis labels. I've tried changing the tickCo...

JQuery templating engines

I am looking for a template engine to use client side. I have been trying a few like jsRepeater and jQuery Templates. While they seem to work OK in FireFox they all seem to break down in IE7 when it comes down to rendering HTML tables. I also took a look at MicrosoftAjaxTemplates.js (from http://www.codeplex.com/aspnet/Release/ProjectRe...

Looping over elements in jQuery

I want to loop over the elements of an HTML form, and store the values of the <input> fields in an object. The following code doesn't work, though: function config() { $("#frmMain").children().map(function() { var child = $("this"); if (child.is(":checkbox")) this[child.attr("name")] = child.attr("checked...

What is the best way to add options to a select from an array with jQuery?

What is the best method for adding options to a select from a JSON array using jQuery? I'm looking for something that I don't need a plugin to do, but would also be interested in the plugins that are out there. ...

What is the best way to remove a table row with jQuery?

What is the best method for removing a table row with jQuery? ...

How do I make an onclientclick post back using jquery? asp.net

Hey guys, I need help. I want to recreate the the update panel postback without using a update panel to do the postback. What is the generic method for doing this? For example, on stackoverflow, when you vote up or down on a question it does a postback to update the database and I would bet they didn't use an update panel. What do I...

jQuery add table row

What is the best method in jQuery to add an additional row to a table as the last row? ...

AJAX and Relative Path Scope

Hi Everyone! First post here and I'm hoping someone can help me out. :) I'm trying to lightbox a page containing a SWF via the nifty AJAX feature in Facebox (for jQuery). The trouble is that the paths now work relative to the main index page, not the directory that houses the flash page. Here's a directory breakdown: ./   - index.html ...

Hook into dialog close event

I am using the dialog from jquery-ui. I am looking for way to refresh the page when in some circumstances when the dialog is closed. Is there a way to capture a close event from the dialog? I know I can run code when the close button is clicked but that doesn't cover the user closing with escape or the x in the top right corner. ...

Populate a form with data from an associative array with jQuery

Last time I asked about the reverse process, and got some very efficient answers. I'm aiming for least lines of code here. I have a form of fields and an associative array in the {fieldname:data} format, I want to populate a corresponding form with it. ...

Detecting when a div's height changes using jQuery

I've got a div that contains some content that's being added and removed dynamically, so its height is changing often. I also have a div that is absolutely positioned directly underneath with javascript, so unless I can detect when the height of the div changes, I can't reposition the div below it. So, how can I detect when the height o...

Getting color of a data series from a flot chart

After seeing the cool new "reputation" tab on the stackoverflow user page, I was inspired to play with the Flot charting library a little. I have a line chart that has several hundred series. Only a couple of these series will be visible at any given time. My data series are grouped into several "categories" and I assign the numeric c...

jQuery: Problem with windowed controls in IE6

I have a web page which contains a select box. When I open a jQuery Dialog it is displayed partly behind the select box. How should I approach this problem? Should I hide the select box or does jQuery offer some kind of 'shim' solution. (I have Googled but didn't find anything) Here is some code: <!DOCTYPE html> <html lang="en"> <hea...

How do you trigger javascript functions from flash?

How do you trigger a javascript function using actionscript in flash? The goal is to trigger jQuery functionality from a flash movie ...

Should I create a JQuery server control for ASP.net to best use it in my apps?

I have been rather successful in promoting JQuery within my organization. No small feat on it's own. However, one of the ideas being kicked around here to make it part of our app is to create an ASP.net server side control. (We are going to be sticking with WebForms for the foreseeable future.) I'm not too wild about this approach as it...