jquery

JQuery - Adding Cells to Dynamic Tree Table

I can't quite wrap my head around this one... A table like the one below is spit out by a renderer from some XML. The XML it comes from has a variable depth. (Please point out if I'm using the rowspans in a horrific manner as well, I just came to this table with some experimentation). <table border="1"> <tr> <td rowspan="12...

Append indexed input fields with attached datepicker widget

I am looking for the most efficient way to add a set of fields with datepicker widget attached on click event. So here I have a set of indexed events being generated on a page: <div id="events"> <div class="event"> <input type="text" id="event_0_startDate" name="event[0].startDate" class="date"/> <input type="hidden" id="even...

Loading Google Visualisations via Ajax

Hello, I have several tabs in my application, and each tab loads a different sub-page via jQuery load() function. My problem is that some of the pages contain Google Visualization plugins and these will not work. My first approach was to have the JavaScript for the Visualization API in the sub-page being loaded, but that did not work...

Using JQuery to open a popup window and print

Hello, A while back I created a lightbox plugin using jQuery that would load a url specified in a link into a lightbox. The code is really simple: $('.readmore').each(function(i){ $(this).popup(); }); and the link would look like this: <a class='readmore' href='view-details.php?Id=11'>TJ Kirchner</a> The plugin could also acc...

How to make the value of one select box drive the options of a second select box

I want to make an HTML form with 2 select boxes. The selected option in the first select box should drive the options in the second select box. I would like to solve this dynamically on the client (using javascript or jQuery) rather than having to submit data to the server. For example, let's say I have the following Menu Categories a...

jQuery 1.4.2 JSON format breaking what used to work in 1.3.2

I just upgraded my jQuery from 1.3.2 to 1.4.2, and I think it's giving me some issues. I have a $.post() function that calls a controller method and passes along some data that I format like so: $.post(url, { arrayParam: myArray, param2: false }, someCallback, 'html'); In Firebug, the POST says the parameters in 1.3.2 look like this: ...

How Do I Create Expand All and Collapse All Links Outside of the jQuery Treeview Plugin?

The jQuery Treeview Plugin adds Collapse All, Expand All and Toggle All links to the "treeviewcontrol" div when the control property is defined as follows: $("#black, #gray").treeview({ control: "#treecontrol", persist: "cookie", cookieId: "treeview-black" }); This works great, but I'd like the ability to expand and collapse ...

How do you pass a JSON object to an MVC action parameters?

I would like to pass {"id":1, "name":"stackoverflow", "parameter2":false, "parameter3":true} To my action public JsonResult Action(int id, string name, bool parameter2, bool parameter3) { //... } Using JQueries ajax method using the JSON as the data parameter $.ajax({ url: "target.aspx", data: {"id":1, "name":"stackover...

Overriding deep functions in javascript

I'm quite new to javascript but have undertaken a task to get better aquainted with it. However, I am running into some problems with jQuery. The following javascript is the code that is in a third party jQuery plugin and I would love to be able to override the funFunction() function here to do my own implementation. Is this possible, if...

What does this JavaScript error mean?

Using the “Venkman” JavaScript debugger for Mozilla and getting the following error: XML Parsing Error: not well-formed Location: x-jsd:source?location=http%3A%2F%2F192.168.1.150%2Fscript.js&instance=337 Line Number 557, Column 50:<line><margin x='t'> - </margin><num> 554</num> �� valid = false;</line> Functions works b...

Retrieving an element by array index in jQuery vs the each() function.

I was writing a "pluginable" function when I noticed the following behavior (tested in FF 3.5.9 with Firebug 1.5.3). $.fn.computerMove = function () { var board = $(this); var emptySquares = board.find('div.clickable'); var randPosition = Math.floor(Math.random() * emptySquares.length); emptySquares.each(function (inde...

How do I manipulate a jqGrid's search/filters?

I have a jqGrid with a navBar that has search: true and multipleSearch: true. I would like to add a button to my UI that automatically adds an additional rule to the search. I've tried manipulating the postData for the filter directly, but values added this way don't show up in the search UI. I've also tried accessing the search box di...

JQuery + Rails + Select Menu

I want to have a select menu to change a field on a Customer dynamically, I've never used Jquery with a select menu, and I'm having problems. The code: <% form_for @customer , :url => { :action => "update" }, :html =>{:class => "ajax_form"} do |f| %> Pricing: <%= select :customer, :pricing, Customer::PRICING, {}, :onchange => "$('this...

jQuery, Animate opacity to 1 then remove the opacity property to make it better looking on IE

Hi everyone, I tried the jQuery fadeIn animation in all browsers and it work good, but not that much on IE. the Alpha png images are so creepy after appending the CSS opacity, but i have an idea and i don't know how to implement it using jQuery. The idea is to fadeIn the element and when the animation is finished it will automatically ...

Using JQuery getJSON method

Hi, I am attempting to pase a a JSON data using the JQuery getJSON function. The REST query is: http://query.yahooapis.com/v1/public/yql?q=select%20woeid%20from%20geo.places%20where%20text%20%3D%20%22london%22&amp;format=json&amp;jsoncallback=? The script I'm using to parse 'data' to obtain the WOEID value doesnt seem to work below:...

jquery strange flickering on mouseover/out

The HTML: <div id="timerList"> ... <li rel="project" class="open"> <a class="" style="" href=""><ins>&nbsp;</ins>Project C</a> </li> ... </div> The javascript/jquery: $('#timerList li[rel="project"]').mouseover(function(){ $('a:first',this).after('<span class="addNew"><a href="#">Add Timer</a></span>'); }).mouseou...

JQuery dialog momentairly displayed on page load

I created a page that has a JQuery based dialog using the standard JQuery UI function. I do this with out of the box functionality of JQuery... nothing special at all. Here is my HTML for the dialog: <div id = "myDialog"> <!-- ... more html in here for the dialog --> </div> Then the JQuery called in javascript that transforms the ...

How to create a JQuery Clock / Timer

I have a simple quiz application and I want display a nice timer / clock at the top of the page which shows the user how long they've been going for. (If I could somehow show them a timer for Total Quiz Time and also a second one for This Question Time that would be even cooler but I should be able to figure out how to do myself that onc...

Selecting only first level element, not child elements with the same element name

How would I select only the first level .block and not any of the children? $('.block:not("Children of this here")') <-- <div class="block"> <!-- this --> <div class="block"> <!-- not this --> <div class="block"> <!-- not this --> </div> </div> </div> <div class="block"> <!-- and this --> <div class="block"> <!-- not th...

How do I use jQuery to omit the "Select All" check box from the list of elements sent to the server?

When the "Select All" check box is used, it also sends that check box and it's value to the server. How do I remove or omit it from the node list before sending it to the server using jQuery? Thank You. ...