jquery-live

.not() with .live() not working

jQuery("a").not("div#mnuMain a").live("click", function(event){ event.preventDefault(); alert("yes I got u"); }); How to make it work? ...

Jquery - Cannot post form that contains live data appended using jquery.

I have a form that I use to post Live data that is appended to the form using Jquery. The data that is appended contains an input box containing the value of the data I want the form to post. Everything works in Chrome, Firefox and IE8 but not IE7. Why can't IE7 post live data. What am I doing wrong is there anyway to get around this???...

What is the difference between .click(...) and .live('click', ...) ?

Consider the following code: HTML: <div id='button' class='enabled'>Press here</div> <div id='log'></div> CSS: #button { width: 65px; height: 25px; background-color: #555; color: red; padding: 10px 20px; } #button.enabled { color: #333; } #button.enabled:hover { color: #FFF; cursor: pointer; } JavaS...

In jQuery, how can I monitor a dynamically populated element (AJAX), without basing it on an event?

I have the following markup on page load: <select name="sel_billing_address"></select> After page load that select is then populated by some AJAX to be something along the lines of: <select name="sel_billing_address"> <option value="1">hi</option> <option value="2">there</option> <option value="3" selected="selected">sally</opt...

Updating a DIV while writing text into a textarea

Hello I would like to "live" update a DIV in the page with the text the user enter in a textarea. I have the following markup <div id="previewNote" class="note yellow" style="left:25;top:25px;z-index:1;"> <div class="body"></div> <div class="author"></div> <span class="data"></span> </div> and wrote this jQuery code /* L...

jQuery live event replacing inner HTML on anchor tag

I have the following which works but when the user presses 'more' <a> tag (although styled as a button) it then puts a loading gif inside it but from the time the user clicks the button to when the image appears is noticeable. Almost 1 second which makes it look ugly. It looks like it removes the inner HTML has a think and then populat...

Are delegate methods wasteful?

Here said $("table").delegate("td", "hover", function(){ $(this).toggleClass("hover"); }); is same to $("table").each(function(){ $("td", this).live("hover", function(){ $(this).toggleClass("hover"); }); }); But I think it is also same to $("table td").live("hover", function(){ $(this).toggleClass("hover");...

second parameter to jQuery's die is a selector string?

I ran into a usage of jQuery's die that is either a custom extension or not documented... According to the jQuery docs, the second parameter should be a method (http://api.jquery.com/die/). I'm seeing a usage where the second parameter is selector string. Does anyone know what this does? $("*").die('click', '.optionsMenu'); I'd...

jQuery Live Get Div Text

I have some radio buttons that are created dynamically with javascript. I need to figure out how to reference the text in a div (also created dynamically) Here is sample html: <div> <div class="div_ceck"><input id="shipping_service_1" name="sid" value="1" type="radio"></div> <div class="free"><label for="shipping_service_1" id="shipp...

How To I Replace New Elements Added To A Page With Jquery

Here is the scenario... I have a a checkbox next to each field that I am replacing on page load with jquery with "Delete" text that enables me to delete the field via jquery, which is working fine. Like so... $(".profile-status-box").each(function(){ $(this).replaceWith('<span class="delete">' + 'Delete' + '</span>') }); The problem...

jQuery live preventDefault failing on input elements

I have the following snippet of code: $('#messages input').live('keydown', function(e){ if(e.keyCode == 13) { alert($(this).attr('value')); e.preventDefault(); return false; } }); where "#message input" is obviously a group of input text elements. I want to catch the "enter" key and prevent it from refreshing the page....

livequery not always live when used with jquery.validate

I use jquerylive plugin to add additional css classes to .field-validation-error class like this: $(".field-validation-error").livequery(function () { $(this).addClass('ui-state-error ui-corner-all'); }); when I get some spans with this class generated by jquery.validate the above code works, but at 2nd validation it doesn't. h...

How do you use jquery .live() with keystrokes?

I am building a photography portfolio for a client and decided to make it a little bit more interactive. I got rid of all buttons on the site and had the user interact with the site using key strokes. My original code used: $(document).bind('keydown', function( e ) { but this unfortunately would not allow the user to interact with the...

Drawbacks to always using live() instead of bind() for unique dom elements ?

When writing jQuery binding events, I typically use the bind() aliases (click(), submit(), etc). But, the more I use dynamically generated content, the more I find its ambiguous as to when bind() won't work, and end up debugging for a half hour until I try live() and it works. Within the parameters of ID-selectors (like '#foo', not ....

Using jQuery's live() with a selector containing next()

Hello Folks, I do use jQuery live() to bind a 'click' event to certain images. This results in the following internal live-selector: #tblViews tbody tr[rel=view_4].next() table.editable.includes span.actions img.remove When I click on such an image, the following error occurs: Syntax error, unrecognized expression: ) I think the p...

[SOLVED] Jquery live does not seem to work in nested calls

Hi, I am encountering a problem of jquery live function not consistently working for me (or that what I think). I have the same html form which is used for both adding new comment and editing an existing one; this form is propagated using a php code at the server side through a GET call. The two forms are displayed in two different ta...