jquery

Changing and Submitting URL with unobtrusive jQuery?

I have a bunch of urls that toggle user settings I would like to add some unobtrusive jQuery so the page doesn't have to reload every time. Everything I've found so far deals with forms, where as this is just a URL submit via js. How do I add ajax url submit to the a attribute. Ex: <a class="user_attrs" href="/users/testuser/attr/img...

Rotate sprite javascript

I have a sprite animation, a small cannon rendered using a 3D app. I have exactly 360 frames for a 360 degree turn. Each image has a 100x100 pixel size. So basically what I am trying todo is when I click anywhere in the page, the barrel of the cannon needs to rotate to point at the mouse cursor, sound simple maybe but I can't really get...

How can I absolutely position jQuery draggables and still make them move correctly for droppable to work? (a problem just with IE)

Hello, I've read lots of articles and tried everything I can think of, but I can't manage all three: position a draggable object, make it move correctly and get the droppable object to recognize it. When I change the code, I manage every time to do one or two of them, but never all of them together, and I need them all. Here is some co...

Javascript URL inside an iframe does not execute in Firefox

I have written this code for Firefox: <html><head><title>No</title> <script type="text/javascript" src="jquery-1.4.2.js"></script> </head> <body> <form action="javascript:void(alert('Yes'));"> <input type="submit" value="Submit"> </form> <script>$($('form').submit())</script></body></html> It correctly displays the alert box. However,...

splitting a list in jQuery - conscious of memory and reusability.

I'm trying to write a function in jQuery that will split lists - or really, any element that has children - that is conscious of memory use and is general enough to be widely reusable, but I'm having trouble resolving these against one another. For the sake of argument (and to keep the code on point) let's say I'm trying to split the li...

Jquery nestedSortable and MYSQL adjacency list model

Hi there... I have the following table using the MySQL adjacency list model: id | parent | name | order ----------------------------------- 1 | 0 | Kitches | 1 4 | 0 | Chairs | 2 5 | 0 | Sofas | 3 43 | 4 | Blue | 1 44 | 4 | Red | 2 Implemented the Jquery nestedSort...

jQuery BBQ, deep-linking HREF's with a set Class --- Possible?

Currently, my understanding of jQuery BBQ is it requires me to use an href like href="#/stufff/123/13" Problem with that is it requires me to add a # to all my URLs throughout the site which then means non-javascript browsers can't use the site... My question, is there a way I can simply add a class to all HREFs I want deep linked? so...

jQuery: Load data on a combo box depending on another

I have two combo boxes. Let's say the first one had values A, B, C And when I select A the second one should show me options 1, 2, and 3 If I select B, then the second one should have the options 4, 5, and 6 and C should make the second combo box have the options 96, 98, 100. Is there a way to do this via jQuery?? Thank you very muc...

Detecting Order of Checkbox Selection and Passing along Data V2

Hi, Im trying to create a page that allows a user to select a maximum of 8 checkboxes out of 25 checkboxes total, While at the same time detecting the exact order the user clicked the checkboxes. My question is, What code can I add to the javascript to gather this info and pass it along to a page named check_combination.php I have been ...

String replace in var with jQuery.

Hi, I am having trouble trying to get all my form data and break it down for debugging. I just want to replace the "&" with a new line. var formData = $("#customer_details_form").serialize(); var debugData = formData.text().replace(/&/g,'\n'); Thanks ...

jQuery change all tr classes after specified one

I have a data table with alternating row background colors. I have an AJAX script to delete a row. I can't come up with a way to change the class of all the rows beneath the one that was deleted so that it alternates correctly again. For example, considering the following: `<tr id="1" class="row1"> <td>blah</td> </tr> <tr id="2" c...

jQuery: but what about all the children!?

I feel like I have to use way too many .children() in some of my jQuery functions. Here's my HTML: <div class="goal-small-container"> <div class="goal-content"> <div class="goal-row"> <span class="goal-actions"> And here's my jQuery: $('.goal-small-container').hover(function() { $(this).children('.goal-content').chil...

jQuery - Fire a function on a element

Hi I need to add a color picker to some input elements. I'm using $(".element").colorPicker(){ ... } This works perfectly. The problem is that the page has a AJAX form, which - when submitted - will overwrite the previous form with a new one (new input fields etc). After that the colorPicker stops working. So how can I fire that fun...

Call some jquery 3 seconds after .load()

I have this this jquery that loads a success message in a modal: $('#menu_access').load( site_url + sUrl, function() { $(this).dolPopup(oPopupOptions); } ); I want to call this function three seconds after the load: $('#menu_access').dolPopupHide({}); I'm not sure how to go about it. I'm not too familia...

reliable HTML/Ajax control to manipulate tree structures?

Can someone recommend a reliable HTML tree control that also supports tree manipulation? I need it for a backend and want to move, reorder, delete, add and rename nodes. Right now i use a nested set model in my database to store the tree structure, and dhtmlxTree (see dhtmlx.com) as tree control. The problem i'm having is that this co...

Any suggestion on handling unwanted text in a textfield in ruby on rails?

Ok so i have this problem i am trying to address. I have this textfield with the id of request_money <input id="request_money" name="request[money]" size="30" type="text"> In this textfield i have a watermark plugin that i am using with the text "Not now" which is happening via jQuery $("#request_money").Watermark("Not Now"); This ...

Retrieve jQuery requested ajax URL and compare if matches

I am trying to grab the requested AJAX URL generated by a plugin to use in my callback. My intention is, to say in plain English: If the current requested AJAX URL matches attribute href in a certain selector already available in the page, then do something. $(selector).myplugin({settings},function(){ if (currentAjaxURL == $(anoth...

fcount is undefined

I have a variable that I use for caching or temporary storage to avoid repeated requests to the server: var div2acc = {}; Then there is this function which gets an array from a WCF service or reads it from my div2acc object: function getAccounts(div_id){ if(!div2acc.hasOwnProperty(div_id)){ $.ajax({ ...

jQuery - call function based on page id

hi, how can I check the id on every page's <body> tag and perform a set of unique jQuery functions based on the page's id? for example, I have a page with id=red and another page with id=blue. On page load, I need to check the id and then assign the appropriate color to a div on the page. thanks ...

Replace Appended text with new text on Click

With jquery I am adding a div and appending the text "click to view" when the div is showin I would like to change that text to "click to close" Right now I have $('#toggle_template') .css('cursor','pointer') .append(' (click to view)') .click(function(){$('#template').toggle(500); $('#toggle_template').find(' ...