jquery

How can I reimplement external pop-up jQuery code in Prototype?

I have this code in jQuery, that I want to reimplement with the prototype library. // make external links open in popups // this will apply a window.open() behaviour to all anchor links // the not() functions filter iteratively filter out http://www.foo.com // and http://foo.com so they don't trigger off the pop-ups jQuery("a[href='ht...

Queuing actions (not effects) to execute after an amount of time.

What I'd like to know is if there is a nice way to queue jQuery functions to execute after a set amount of time. This wouldn't pause the execution of other functions, just the ones following in the chain. Perhaps an example of what I'd envisage it would look like would illustrate: $('#alert') .show() .wait(5000) // <-- this b...

jQuery attribute selectors: How to query for an attribute with a custom namespace

Suppose I have a simple XHTML document that uses a custom namespace for attributes: <html xmlns="..." custom:xmlns="http://www.example.com/ns"&gt; ... <div class="foo" custom:attr="bla"/> ... </html> How do I match each element that has a certain custom attribute using jQuery? Using $("div[custom:attr]") does not work. ...

jQuery/Javascript to replace broken images

I have a web page that includes a bunch of images. Sometimes the image isn't available so a broken image is displayed in the clients browser. How do I use jQuery to get the set of images, filter it to broken images then replace the src? --I thought it would be easier to do this with Jquery, but It turned out much easier to just use a...

Best cross-browser method to capture CTRL+S with JQuery?

My users would like to be able to hit Control+S to save a form. Is there a good cross-browser way of capturing the Ctrl+S key combination and submit my form? App is built on Drupal, so jQuery is available. ...

JQuery create select list options from JSON, not happening as advertised?

How come this doesn't work (operating on an empty select list <select id="requestTypes"></select> $(function() { $.getJSON("/RequestX/GetRequestTypes/", showRequestTypes); } ); function showRequestTypes(data, textStatus) { $.each(data, function() { var option = new Option(thi...

Can JQuery read/write cookies to a browser?

Simple example: I want to have some items on a page (like divs or table rows) and I want to let the user click on them to select them. That seems easy enough in jquery. To save which items a user clicks on with no server-side post backs, I was thinking a cookie would be a simple way to get this done. Is this assumption that a cookie is...

JQuery error option in $.ajax utility

The documentation indicates that the error: option function will make available: XHR instance, a status message string (in this case always error) and an optional exception object returned from the XHR instance (Book: JQuery in Action) Using the following (in the $.ajax call) I was able to determine I had a "parsererror" and a "timeout"...

Automated Unit Testing with JavaScript

I'm trying to incorporate some JavaScript unit testing into my automated build process. Currently JSUnit works well with JUnit, but it seems to be abandonware and lacks good support for AJAX, debugging, and timeouts. Has anyone had any luck automating (with ANT) a unit testing library such as YUI test, JQuery's QUnit, or jQUnit (http...

Best jQuery Book: jQuery in Action vs. Learning jQuery

So I started using jQuery the other day and upon many blogger recommendations I placed my order for jQuery in Action at Amazon. Only to find out a day later, when I expected it to arrive, that it was out of stock. If you have read both could you please recommend one over the other. Currently jQuery in Action is out of stock with Amazon ...

wysiwyg Text Editor (for webpage)

I am looking for a lightweight simple wysiwyg editor for a site I am working on. I have seen a couple but not really be too impressed with them. Which ones would you guys recommend? btw I need it to work on php4 and on ie6(there went half of em). The one here on stack overflow is really nice. I noticed it was using jQuery, which is a ...

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...

jQuery Menu and ASP.NET Sitemap

Is it possible to use an ASP.NET web.sitemap with a jQuery Superfish menu? If not, are there any standards based browser agnostic plugins available that work with the web.sitemap file? ...

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...

Auto-format structured data (phone, date) using jQuery plugin (or failing that vanilla JavaScript)

I like jQuery and I was wondering if anyone have used a good plugin or (non-jQuery) JavaScript library that allows for auto-formatting of structured fields like phone numbers or dates. I know of the jquery-ui-datapicker plugin, and not what I am looking for here. You may type in a phone number as 123 which then becomes (123), additiona...

What are JQuery's limitations?

Joel always said to be careful when using 3rd party libraries. From my initial impressions, JQuery is great. What should I beware of when using it? What are it's limitations? What headaches will I run into later on as I use it more? ...

How do you fix the flickering that occurs when you use slideToggle in jQuery?

I have a simple unordered list that I want to show and hide on click using the jQuery slideUp and slideDown effect. Everything seems to work fine, however in IE6 the list will slide up, flicker for a split second, and then disappear. Does anyone know of a fix for this? Thanks! ...

Combining Scriptaculous and JQuery in a Rails application

I've got the following situation A rails application that makes use of rjs / Scriptaculous to offer AJAX functionality Lot of nice javascript written using JQuery (for a separate application) I want to combine the two and use my JQuery based functionality in my Rails application, but I'm worried about JQuery and Scriptaculous clashin...

How do I cancel a text selection after the initial mousedown event?

I'm trying to implement a pop-up menu based on a click-and-hold, positioned so that a (really) slow click will still trigger the default action, and with the delay set so that a text-selection gesture won't usually trigger the menu. What I can't seem to do is cancel the text-selection in a way that doesn't prevent text-selection in th...

"No symbols loaded for the current document" Visual Studio 2008 Javascript Debugging

I'm working on a .net 3.5 website, with 3 projects under one solution. I'm using jquery in this project. I'd like to use the visual studio javascript debugger to step through my Javascript. If I set a breakpoint in any of the .js files I get a warning that says "The breakpoint will not currently be hit. No symbols have been loaded for th...