Skip to content
Advertisement

Tag: jquery

jQuery UI Autocomplete

I am using jQuery UI’s autocomplete plugin and everything is well and good except for that fact that when a user clicks the value they want the function I have assigned to the “select:” method fires before the value of the field is changed. So if I type “Foo” in the input field, then click the autocomplete match for “Foo

What is the purpose of backbone.js?

I tried to understand the utility of backbone.js from its site http://documentcloud.github.com/backbone, but I still couldn’t figure out much. Can anybody help me by explaining how it works and how could it be helpful in writing better JavaScript? Answer Backbone.js is basically an uber-light framework that allows you to structure your Javascript code in an MVC (Model, View, Controller) fashion

Max characters in textarea with jquery

I have the following code, and I’m kind of stuck on what to do next. The idea is when you enter text into a text area a counter tells you how many characters you have left. Once you get to the max characters I want to stop allowing characters to be entered, or delete all the characters that were entered

How to find the 2nd closest ancestor in jQuery?

My DOM looks something like this: When the used clicks on ‘Edit’, I want to change the outer <li> to <li class=”selected>. I tried something like this, but this is not working: Any help is appreciated. Answer Go up a parent: It wasn’t working because closest starts with the current element, and so if you call it on something that

Regular expression [Any number]

I need to test for “[any number]” in a string in javascript. how would i match it? Oh, “[” and “]” also need to be matched. so string like “[1]” or “[12345]” is a match. Non match: “[23432” or “1]” So for example: I need to replace input fields name: “items[0].firstname” to “items[1].firstname” thanks Answer UPDATE: for your updated question

Advertisement