jquery

jQuery datepicker - Restrict dates from server side (ASP.NET)

I have a jQuery datepicker that I want to restrict non work days - weekends, public holidays etc. I have seen examples on how to do this from the client side (javascript), but is there a way to restrict the dates from server side ASP.NET code? I figure you could do using Page.RegisterClientScriptBlock, but was wondering is there a neate...

How can I pass arguments to anonymous functions in JavaScript?

I'm trying to figure out how to pass arguments to an anonymous function in JavaScript. Check out this sample code and I think you will see what I mean: <input type="button" value="Click me" id="myButton" /> <script type="text/javascript"> var myButton = document.getElementById("myButton"); var myMessage = "it's working"; myButto...

Get relative position between 2 DOM elements using JavaScript

I've implemented a set of draggable elements that can be dropped into some containers using jQuery. What I need is an animation that moves an element to a specific container without user interaction. The problem is that the elements and the drop containers are in completely different parts of the DOM and mostly positioned using float. A...

Parse RSS with jQuery

I am looking for a jQuery solution to parse RSS feeds. I want something reusable and easy... Know of a plugin? Or a way to do this with jQuery base? ...

JQuery Tabs - issue with nested tabs - Activating sub tab on initial load

I have an issue with nested jquery tabs and needs some help/pointer. Currently I have 5 Parent tabs and have few sub tabs under each parent tabs. When page gets loaded I want to show a particular Parent tab and one of its child tab active. I am able to activate a particular parent tab but same is not working with child tabs. Pleas...

.load in jQuery not loading cfcharts in IE6

I am trying to dynamically load the contents of a div tag with a .cfm page that contains a cfchart in png format. When the user clicks on a link, I am using the load function to put the .cfm page into the div. $("#bank").bind("click", function(){ $("#chartx").load("bank.cfm"); }); I can get this to come up perfectly in Firefox, bu...

Best way to implement .lastChild using Prototype or jQuery

Currently we are using prototype and jQuery as our js frameworks. Right now, jQuery is set to $j() to prevent conflicts from prototype. In the past, we've used a lot of prototype's Element.down(), Element.next(), and Element.previous() to traverse the DOM. However, I need a simple way to retrieve the last child element. I know i can loo...

Dynamically Set the Height of Two floated DIVS

The coding is done using VS2008 There are two divs in my page namely "dvLeftContent" and "dvRightContent". I cannot statically set the height of the pages since "dvRightContent" have variable heights on various pages (Master Pages are used here) Is there a client side function(javascript or jquery) that takes the height of the right div ...

jQuery resize not working at FireFox, Chrome and Safari

$("#dvMyDIV").bind("resize", function(){ alert("Resized"); }); or $("#dvMyDIV").resize(function(){ alert("Resized"); }); The questions Why is this not working at FireFox, Chrome and Safari? Can this be considered a jQuery bug since the resize is not handled for other browsers? Could the only workaround be calling a...

jQuery - Ajax

Hi. In A.ascx I have one DropDownList and one DIV. The DropDownList is populated dynamically. How do I load B.ascx into the DIV, when the user changes the selected index in the DropDownList. This should be done on the client side without postback, by using jQuery and Ajax. Thanks ...

How to use jQuery to call an asp.net web service?

I'm trying to use jQuery to get data from an ASP.NET web service (SharePoint Server 2007 lists.asmx) but any call to a web service will really help as a first step in that direction. ...

JQuery Conditionally submit forms

I have a table with multiple rows. Each row is a form. I want to use JQuery to submit all the forms that have the check box checked. The form is posting to an IFrame so there is not much need for AJAX. So far I have: $("form").submit(); which submits the form. but all forms. There is arbritary number of rows, could be 80-100. ...

Asp.Net jQuery $.getJSON sometimes causes full page postback?

I'm writing an ASP.NET webforms app, and I'm using jQuery for my AJAX calls. This is working well, but on some occasions, the $.getJSON call is causing a full page postback. I am not using the ASP.NET AJAX library anywhere in the app. I can't reproduce the problem on a consistent basis, and am not sure what is causing it. Here is the jQu...

Loop through <select> and build array in the format: "value1","value2","value3"...

I wonder if anyone could suggest the best way of looping through all the <option> s in a <select> element with jQuery, and building an array. Eg. Instead of the following, whereby a string ins passed to the autoCompleteArray(), $("#CityLocal").autocompleteArray( [ "Aberdeen", "Ada", "Adamsville", "Zoar" //and a million oth...

Animating inline elements with JQuery

I am trying to show and hide an inline element (eg a span) using jquery. If I just use toggle(), it works as expected but if I use toggle("slow") to give it an animation, it turns the span into a block element and therefore inserts breaks. Is animation possible with inline elements? I would prefer a smooth sliding if possible, rather ...

jQuery Element Swap

I have 3 divs where only one is visible by default, they each contain information about a product. Below this divs is a list of 3 images which are images of the products. By default of course the 1st list item is selected and has class="selected". When a different product image is clicks then class="selected" moves to that list item and ...

How do I pre-populate a jQuery Datepicker textbox with today's date?

I have a very simply jQuery Datepicker calendar: $(document).ready(function(){ $("#date_pretty").datepicker({ }); }); and of course in the HTML... <input type="text" size="10" value="" id="date_pretty"/> Today's date is nicely highlighted for the user when they bring up the calendar, but how do I get jQuery to pre-populate...

Dynamic Associative Array Creation in Javascript from JSON

It sounds a lot more complicated than it really is. So in Perl, you can do something like this: foreach my $var (@vars) { $hash_table{$var->{'id'}} = $var->{'data'}; } I have a JSON object and I want to do the same thing, but with a javascript associative array in jQuery. I've tried the following: hash_table = new Array(); $.eac...

Find & replace jquery

I have this code to give me a rollover on submit buttons, and I'm trying to make it more generic: $('.rollover').hover( function(){ // Change the input image's source when we "roll on" srcPath = $(this).attr("src"); srcPathOver = ??????? /*need to manipulate srcPath to chang...

jQuery Swapping Elements

Ok let me make an example: <head> <script type="text/javascript"> $(document).ready(function(){ $("#options_2").hide(); $("#options_3").hide(); }); </script> </head> <body> <div id="options_1">option 1</div> <div id="options_2">option 2</div> <div id="options_3">option 3</div> <a href="" class="selected">choose option 1</a> <a...