jquery

clone then alter table row before inserting back with jquery

I have 2 tables one, with a list of products to choose from and one with products chosen. I also have a link in each to add from one and delete from the other. When you delete from one of the tables I want to copy and insert into the other table but I need to change the link href before doing so, then add a click behavior to it. Here ...

Twitter username input field text plugin!!

Hello, I'm looking for a nice plugin that filters a username input field like Twitter. I tried to user their script but it's impossible to understand. I found other plugins over the net but they don't usually block special characters like é, á, ç, ã and etc.. Twitter script does! Do you know where I can find it? Thanks ...

Which one is better framework for Enterprise level JS programming - jQuery or Prototype and why?

I'm trying to choose a JS framework to be able to stand the test of time (still usable and scalable in 5+ years), with a good solid code foundation for other programmers to code their own extensions or projects (from complex animation to multi-threading Ajax). These are the things I'm comparing: Extensibility Scalability Consistent and...

IE - Prevent focus (click, doubleclick) on a select box if it has a specific class

I'm using javascript to simulate a disabled select element. I can't actually disable it as the .net validators fail, but that's another story. I have the following function: function preventFocus(e) { if ($(this).hasClass("disabled")) { e.preventDefault(); this.blur(); } } That is called here: $("#ProvinceID").toggleClas...

Retreiving one element from jQuery each function

Hi, basically I am parsing a xml file and retreving certain elements from that xml file using the each function. However I now need to just return the first value, not 'each' value. If anyone could help it would be awesome. Code so far: // basic ajax call to retrieve xml file - then on success sent over to checkNotDate function $('#no...

How to retrieve header response with ajax in jQuery?

Is this layer accessible for ajax? ...

Why is OnBeforeUnload firing twice with asp:LinkButton?

I have the following Jquery function to notify the user with a prompt when they have unsaved changes (similar to how SO does it) and are trying to leave the current screen. <!-- in my aspx page --> <script type="text/javascript" language="javascript"> window.onbeforeunload = function() { if (HasPendingUpdates()) ...

How can I iterate over cookies using jquery (or just javascript)?

I am using the "Cookie Plugin" by Klaus Hartl to add or update cookies at $(document).ready. I have another event that is supposed to iterate all the cookies and do something with the value of each cookie. How can I iterate over the collection of cookies and get the id and value of each? I'm thinking something like this: $.cookie.each(...

jQuery: check if element has CSS attribute

Is there a way to check an elements parents and find the first one that has a CSS background set and then return that background value? Something like: var background = $('element').parents().has(css('background')); UPDATE: This is the code I'm now using: jQuery.fn.getBg = function(){ var newBackground = this.parents().filter(fu...

jQuery - overlapping click events... How to prevent one

I'm currently working with a click event that fires an ajax call. I'd like to leverage a small plugin which, will handle some form data validation. The problem is that both the ajax call and the validation function of the plugin will be fired on the same click event. In the end, I'd like the plugin to override the ajax function. I'm not...

jquery show and hide on same link click

hi everyone, I have a div and I want to show and hide on a link click. Not two different links to show and hide but only one. I have used toggle() but its not working for me.. Here is the code <a id="showhidediv">show-hide</a> <div id="maindiv"> <div id="innerleftdiv" style="width:49%;float:left"> </div> <div id="innerrightdiv" sty...

Is separation of Content, presentation and behavior possible every time ?

Is separation of Content, presentation and behavior possible every time ? Many time through javascript we add classes to html and we use in CSS visibility:hidden inline. Should we always invest time ti keep all separate? ...

Jquery Applying plugins to "display:none" elements

Hello, i am running into the same problem again, i have some display:none elements on my site and i cant´t apply jquery plugins on them. i am using the jScrollPane Plugin for example. http://www.kelvinluck.com/assets/jquery/jScrollPane/jScrollPane.html with: $(function() { $('.scroll-pane').jScrollPane(); }); you can activate i...

javascript based progress bar

Hello, I am curious how can a javascript (or also benefiting from jquery) based progress indicator such can be developed: My first idea is something such as: function drawBar(total,sofar){ ......................... } where it consumes the max number(20 in our case) and sofar (15 for the picture). But how can it be implemented? I...

jquery cycle plug-in pager being covered over

I'm trying to create an automated image slider/carousel using the jQuery cycle plug-in and the pager option to allow for navigation. Its meant to fade from one image to the next, and provide a series of pager elements that partially cover over the image much like this example here For all intents and purposes its functioning fine, but ...

jQuery - find a value relative to a clicked element

I am trying to get the text value of a table cell relative to a clicked link. Click the link in any of the cells of class 'three" and get the text of that particular row's cell named class 'one'. <tr> <td class='one'><a href="#">Text to get</a></td> <td class='two'>meh</td> <td class='three'><a href="#">Click this to get the text in th...

convert a HTML table data into a JSON object in jQuery

Anyone know how to convert a table of values into a nice JSON object to be manipulated with jquery? EDIT: Sorry, HTML table! ...

How would you animate something so that it follows a curve?

If I have <div id="curve" style="position:relative; height:100px; width:100px; /> How would I make it move on a curve? I've googled and everything but can't seem to find another example that would call two functions at once. This is the kind of code I would like, but doesn't work: $('#curve').click(function () { $(this).animate( ...

jQuery check if element contains any attribute

Hi, I can check if an element have a specific attribute with: if ($('#A').attr('myattr') !== undefined) { // attribute exists } else { // attribute does not exist } How can I check if an element have any attribute? Thank you ...

Replacing MouseOver with .hoverIntent

First off I apologize... I have posted this question before but I did a bad job of explaining it. I'm having trouble plugging hoverIntent into the following JavaScript... I need it to replace the "mouseenter" and "mouseleave" functions below. Just to be clear, I'm asking for help because I'm not very good with javaScript syntax. The s...