jquery

Using jQuery.getJSON in Chrome Extension

I need to do a cross-domain request in a chrome extension. I know I can it via message passing but I'd rather stick to just jQuery idioms (so my javascript can also work as a <script src="">). I do the normal: $.getJSON("http://api.flickr.com/services/feeds/photos_public.gne?tags=cat&amp;tagmode=any&amp;format=json&amp;jsoncallback=?",...

How can I set a jQuery tab number that's present in an ASP.NET MVC model?

Hi, I have an ASP.NET MVC view on which I've placed jQuery tabs. I'm loading the tabs using: function getContentTab(index) { var url='<% = Url.Content("~/Books/GetBookTab") %>/' + index; ... } I have stored the user's default tab selection in the model associated with this view. My question is this, how can I set the tab ...

jQuery fullcalendar custom event

Hi, I was wondering how to apply a custom render to a event... I want to be able to prepend the "patient" name of a practice agenda... eventRender: function(event, element) { console.log(element[0]); } This currently shows the HTML output in the console, but I don't know how can I access it (in a pretty jQuery manner) i...

clear table jquery

I have a table filled with a number of rows. How can I remove all the rows from the table? ...

jQuery selector performance

I have the following two code blocks. Code block 1 var checkboxes = $("div.c1 > input:checkbox.c2", "#main"); var totalCheckboxes = checkboxes.length; var checkedCheckboxes = checkboxes.filter(":checked").length; Code block 2 var totalCheckBoxes = $("div.c1 > input:checkbox.c2", "#main").length; var checkedCheckBoxes = $("div.c1 > i...

Is there any plug-in or library to validate a set of form elements?

Hi guys: I am a noivce at JQuery. I'm curious about if there is any plug-in or libraries to help developers validate whether any input value over a set of form elements is not entered (empty string). I can just think of using a function to achieve this feature. Any better idea? Thanks. ...

N-son tabbed/JsScrollbar, trying to force gif play from click of link using jquery

Hello everyone, Let me start off by stating the obvious; I am new here. That said I hope I am not violating some standard I missed by posting this. xD For several days now I've been trying to update a rather old site of mine, to which I wont link to given that the update is so drastic that the current product on which I seek your help...

Jquery – Append selected items in spans

Hi. I'm trying to select all elements that have a class, get their ID's (if they have one), and append individual spans to the end of my document based on that information. This is as far as I've managed to get: var element = $(".foo"), element_id = element.attr("id"), span_id = "for-" + element + "-id-" + element_id, ; ...

Anybody knows how to make the JSon suggest close on click?

hi guys, i'm using this json suggest box and i was wondering if there's a way to include an option to make it close when the user click on somewhere else? else right now unless the user select something, the suggest box will never close. Or is there another suggest box out there that i can use? basically my data are in json format. ...

get the start position of an item using the jquery ui sortable plugin

I am using the jQuery UI sortable plugin and I am trying to get 2 alerts I want the staring position of the element and the finished position of the element. $(function() { $("#filterlist ul").sortable({ opacity: 0.6, cursor: 'move', update: function(event, ui) { alert(ui.item.prevAll().length + 1); } }); ...

How do I add a textbox to my other jQuery click function?

Right now, my script adds a box to the cursor when I click on an image, as can be seen in the following code. Please note, this is jQuery. $(function() { var tag_box = $("<div>").appendTo("body").css({ "width": "40px", "height": "40px", "border": "4px solid #000000", "position": "absolute", ...

WCF service - HTTP500

Hi guys, I need help with wcf service. i have a ajax-enabled wcf service: public class AddFavorites : Page { // Add [WebGet] attribute to use HTTP GET [WebGet(RequestFormat = WebMessageFormat.Json)] [OperationContract] public void AddFavorite() { this.AddMyFavorite(10, "sometext"...

Perform jQuery selection on ajaxed html content

Is it possible to load an html document using ajax and then perform a jquery selection on the loaded html? I want to perform a search against a remote search server and then use the results to reformat an existing page. EDIT: the find function doesnt seem to return results (length is always 0). Here is the sample html <html xmlns="ht...

Any good example about Autocomplete with Zend Framework? (JQuery and ZendX)

Hi guys, I have a problem, I don't find good examples of "autocomplete" with zend framework (using jQuery with zendx). I need one that works to understand how to develop it. Someone has done it? Thank you very much in advance PS: I know how to do it without ZendX, I mean, doing the form myself (and using jquery as usual with a autoco...

jquery checkbox help getting checkbox name and value

The Problem I am trying to run some ajax on one my pages for my website, basically I have three checkboxes all of which on pageload are unselected, when a checkbox is clicked I need to be able load in via ajax the relevant HTML. This system is currently a PHP script that depending on what the POST is set returns a different view, so I t...

Jquery .Filter Return an Array of Matched

Hi Guys, I've got a Slider with two handles which filters out some divs based on its price. I need to get an array with the index of the elements which have been matched and filtered to use it on another function. Such as.. var matched = [0, 2, 4, 7]: $("#price").slider( { range: true, step: 5, change: function(e,ui) { ...

has any method like substitute of mootools in jquery ..

this is mootools code: var myString = "{subject} is {property_1} and {property_2}."; var myObject = {subject: 'Jack Bauer', property_1: 'our lord', property_2: 'savior'}; myString.substitute(myObject); and does jquery has this mothod? or like this method ? ...

jQuery; combine user click and :checked

I have two blocks of code which basically check for 1) a click event on a radio button e.g. $("input[id='frmSkill']").click(function(){ //do something }); And 2) a block of code to check if a radio button is :checked, if so, then perform some actions e.g. if($("input[id='frmSkill']:checked").val()){ //do something }); ...

DOM innerHTML Duplicate Problem

function SwapPlans(city, id) { var tp = GetTravelPlanById(id); var content = MakeHTMLAccordionMe(tp.items[0]); document.getElementById(city).innerHTML = " "; document.getElementById(city).innerHTML = content.innerHTML; document.getElementById(city).outerHTML = " "; document.getElementById(city).outerHTML = conten...

Jquery problem - cant expand the row above in a table

Hi People, What I cant figure out is how I would toggle a row in a table using the one below it. So say I have a table with 2 rows the first contains content and the one below contains a button, when the page loads the content row is hidden and when you click the button it toggles the content row on and off. In the example the first t...