jquery

disabled control being reenabled but still not posting back contents to server

I have a couple of radio buttons that are controlling text entry into a textarea. <tr id="trTextNote" runat="server"> <td colSpan="2"></td> <td class="IndentedCell" noWrap colSpan="2"> <asp:textbox id="txtIncludeNote" runat="server" Width="352px" Height="46px" TextMode="MultiLine" MaxLength="250"> </asp:textbox> </...

How to bind to a function dynamically, similar to live

Let's say that I am using a 3rd party utility tool and I can't change the code in that cool. The tool does nothing else but $(this).live('click', function(){ this.trigger('custom:callback'); }); The way I use it is $('a').bind('custom:callback', function(){ alert('callback is being invoked'); }); Above code works fine. However...

Can an input (type=text) be a jQuery droppable?

Hi, I am trying out jQuery-UI drag-drop feature. I was able to easily convert a div into a droppable but making a text box a Droppable doesn't work. jQuery('input[type=text]:visible').droppable({ drop: function (e, ui){ console.log('dropping',ui); //--> this never gets called jQuery(this).val(jQuery(ui.helper).text());...

Readonly input box bug in Internet Explorer

Hi all! I've got a strange bug, well, MSIE does. Seems it is failing on all major MSIE versions: 6, 7, 8 and 9 (!) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-gb" lang="en-gb" ><head><title>test</tit...

Newly created elements without jquery expando attribute aren't maintained by jquery ?

Hello, I have collapsable/expandable tree created in jQuery. After loading the tree: $("#tree").treeview({ collapsed: true, animated: "medium", control: "#sidetreecontrol", persist: "location" }); I have expando data attribute on the nodes, for example: I've written some code which appends new ...

JQuery get all items in a list

Could someone help me out with this JQuery? I have a bunch of list items, and when clicking one of them, I want to remove the class attribute 'selected' from each list item in the same UL. I have a javascript function: <script type='text/javascript'> function clearSelectedCSS(item) { $(item).parent().$('li.itemselected').removeC...

Notifying users of database changes

I have, at its heart, a php/mysql application. Every ~15 minutes new data is added to the database. I want to notify users that new data is in the database. I was thinking of having some JS run on the clients computer to check for updates every 60 seconds, but I don't want to pull down the results unless something has actually changed/be...

jquery .load() page then parse html

Hi, I have used the line below in my app. But now I need to parse the html loaded before I show it. Whats the best way to get certain html elements. $("#div").load("page.html"); Thanks UPDATED Now I am using this but having trouble geting the title attribute of a div with the id "div". function get_title() { $.get("test.html",...

jQuery Autocomplete - Show List on Double Click

I'm creating an autocomplete on a web page using jQuery's AutoComplete plugin. Does anyone know how to make the list show, if for example, someone has entered 3 characters, then clicked out of the input box, but then goes back to it? $("#details_business_trade").autocomplete({ source: resultsSplit, autoFill: true, mustMatch...

jquery table row selector based on user input

How do I select rows depending on what's in an input box? Here's what I have so far: <html> <head> <script src="http://www.google.com/jsapi"&gt;&lt;/script&gt; <script type="text/javascript"> google.load("jquery", "1"); </script> <script type="text/javascript"> $(document).ready(function() { $('#btnFilter').keyup(function() { ...

Descriptive error messages

I have the following jQuery which does not give the most descriptive error messsages... url: 'server_page.aspx', type: 'POST', data: { intID:$(this).attr("id"), strState:"1" }, error: function() { alert('Error'); }, success: function() { } How do I get more descriptive error messages if it is possible? EDIT: This is the full javasc...

.NET Dynamic XML reads fine in all browsers except IE

Using AJAX to pull data from a dynamically generated XML using .NET. Using simple jQuery Ajax: $.ajax({ type: "GET", url: "/test/dynamic.aspx", success: function(xml) { var itemTitleSrc = $(xml).find('ItemName').text(); alert(itemTitleSrc); } }); In Firefox, Chrome, Safari, the alert brings back all of the strings associate...

Code Snippets: Where do I keep them?

Is there a tool or process for keeping your functions, selectors and 'for loops' handy and search-able for future use? I use nothing and am re-learning occasionally for a similar problem I've already solved. background: I'm progressing into jQuery and Javascript and am starting to see some repeating patterns like building complex selec...

When to use $(this).text() and when to use $.text([this])

A previous stackoverflow question had this as part of its solution: $.text([this]) I've never seen that syntax before. The complete statement was: return $.text([this]).indexOf(myInput) == 0 So I'm thinking $(this).text() couldn't be used. Q: Where is $.text([this]) mentioned in any of the documentation? ...

JQuery: Merge multiple JSON results

Situation: User want to import Youtube playlist in a JQuery site using Youtube's JSON API. Problem: Youtube only gives back first 50 entries, but playlists can be 100+ entries long (length is given by 'totalItems' in JSON response). All the entries need to be merged as 1 object and need to be pushed into an output function at the end. ...

Does it make sense to jQuery cache $(this)? IE: $this = $(this)

I'm still learning about jQuery, but I have not been able to find a solid answer. I know every time you use the jQuery selector $(...) there is a performance cost, but does $(this) have a significant cost where you should cache it before using it a lot? var $this = $(this); Thanks! ...

Implementing a random chat among people

My idea is to make a website, where people could registry and search for a people to talk. They can choose people from certain country, genre, with certain age and so on. Yeah, I know there is a lot of websites like this, but I want to implement this, because it looks really challenging. Can you give me ideas how could I implement thi...

Having trouble getting jQuery UI resizable working

I'm sure I'm missing something really obvious (it's late in the day). I've set up a test page with a really basic implementation of jQuery UI resizable. Why isn't it working and allowing the elements to be resizable? http://jsfiddle.net/UA3QS/ ...

Zebra widget doesn't work, if i have a child table?

Hi, I have a problems with the JQuery tablesorter plugin. I use "zebra" widget, but it doesn't work if i have another table in the main table. $("#selection_table").tablesorter( { widgets: ['zebra'] }) if i have another table somewhere in the selection_table, zebra widget stop working properly. Is there a wa...

What's the best way to grab the number in this url string with jQuery or vanilla javascript?

"/organizations/1/media/videos/11" I would like to just grab that 1 . Not sure how to exactly do that. Any ideas? ...