jquery

Getting parent id in jquery

I have the following markup: <ul class="item"> <li id="user_one">Username <ul> <li class="click">Click Here</li> </ul> Basically I want to be able to get the ID of the parent LI. This is what I currently have: $(this).parents("ul").find(".item li").attr("id"); This works sort of, there are man...

How do I scan JSON with jquery to determine the number of instances of a certain string?

Hi, I have some JSON which looks generally like this... {"appJSON": [ { "title":"Application Title", "category":"Business", "industry":"Retail", "language":"English", "tags":[ {"tags":"Sales"},{"tags":"Reporting"},{"tags":"Transportation"},{"tags":"Hospitality"} ], }, { "title":"Airline Quality Assurance", ... ... .....

jQuery .slideToggle does not change size of containing div

I have a simple .slideToggle on my category headings on the website: http://www.UtahCodeCamp.com/Sessions/ : // Slide Toggle the headers $(".collapse-track").each(function () { $(this).click(function () { $(this).next().slideToggle(); }); $(this).css("cursor", "pointer"); $(this).next().hide(); }); Everything works perfectly in...

loop through list with sublists javascript

Hi I have next ul li1 li2 ul3 li3.1 li3.2 ul3.3 ul3.3.1 ul3.3.2 li4 li5 and I must check all items in ul3 I can't be sure if there is only two or three or more lists ...

JQuery Selector problem with prevAll

Hi, I'm having trouble getting some Jquery code to work. I think my problem is stems around how I'm writing the selector. Here's my original HTML: <div class="rotate"> <div class="offer-holder"><span class="lblSeconds">7</span></div> <div class="offer-holder"><span class="lblSeconds">3</span></div></div> ...and here's my Jqu...

jQuery animations not working in Firefox

For some reason animation methods are not working in Firefox. Even basic functions like show() do not work. They seem to work perfectly normal in IE 8. Has anyone else come across this or can explain why this is happening? Edit: Example code - $(document).ready(function() { $(".form_error").show(); }); The css for .form_error se...

Populate textbox from checkbox list using ASP.NET and AJAX

I have a textbox control and a checkbox list control on my page. I am first populating my checkbox list with a list of employee objects in the code-behind. An employee has an id and a name. Both are displayed in the checkbox list like so: Jim (1) Alex (2) Gary (3) When a user checks one of the boxes, the employee's name needs to be ...

How to add a string to a text area with different colours?

Hello all, I am trying to work out how to write a function where I pass in a string and this string is added to a textarea. This I can do, but I want to parse that string and change the colour on different parts of the string. In other words, find the words "select", "where" and turn them blue. Then find the words "AND", "OR", "<" and ...

Ruby on Rails: jQuery why is val not defined?

function replaceIfEmpty(fieldID, value){ alert($j('input#'+fieldID.val())); if ($j('input#'+fieldID).val() == ""){ $j('input#'+fieldID).val(value); } } there's my function, and this is in my controller: page << "replaceIfEmpty('object_name', '#{t.name}');" but when all this is invoked, an alert tells me: R...

jQuery 1.4.2 resizable div stops working once it fits in browser window

Hi all, I have a 'toolbar' div that I made resizable via jQuery UI. The weird thing is, I cannot drag the div unless the div is so long it extends past the viewable page, making the scrollbars appear. I can then drag the div anywhere I like. However, if I drag the div so it fits in the page without scrollbars, and I drop, I cannot resi...

Dynamically creating a json index won't let me access the data within

I'm trying to use jQuery to send an ajax request to a very simple PHP script to load images for the jQuery cycle plugin. I'm having an issue with obtaining the image source strings from my json object. I'll show my code, then go into more detail below: <!doctype html> <html lang="en-us"> <head> <title>jQuery Cycle test</ti...

Binding events to not yet created DOM elements (jquery)

How do I bind events to html elements that don't exist at the time of the script loading? One part of my script adds these to the DOM: <a class="btn-remove-item" href="">link</a> The problem is I can't just do: $(document).ready(function(){ $(".btn-remove-item").click(function(){ this.parentNode.removeChild(this); }...

Having a problem with multiple jquery ui datepickers

i have one jquery ui datepicker working fine. I am now adding a second one (to have start date and end date) and when i click inside the second textbox the datepicker dropdown of the first textbox pops up (instead of the second). has anyone seen this or know of any other quirks when having multiple datepickers: here is my code: jav...

How do I read what is returned via $.ajax()?

I don't receive an alert even though this successfully returns the model I'm requesting? function editaddress(id) { $.ajax({ type: "POST", url: "/Address/Edit/" + id, success: function (msg) { alert(msg); } }); } What is msg? I thought it was maybe a J...

Converting latitude/longitude into city name? (reverse geolocating)

Hello SO, I'm working on a job board in Codeigniter PHP + jQuery where employers enter their location and we use Google Maps API to plot it. While this has had awesome usability results, the problem is when we try to display these locations to job seekers they are muddled and hard to visually discern (they read like this: "02905, 2 mil...

Weird Bubbling Issue

I'm not sure why this is bubbling, but it is. Wondering if anyone has any ideas? $('#file_upload').live('submit',function(event){ $('#file_upload').attr('action','io.cfm?action=updateitemfile&item_id='+$('.agenda-modal').attr('data-defaultitemid')); $('iframe').load(function(){ $('.upload_output').empty(); ...

Auto only once!

Hi! I'm using a jcarousel I've set it to display the images automatically every 1 second. I did this by setting the auto property. I've been looking at ways to do this only ONCE, that is I only one to go through the images once. Not infinite. I changed the wrap property to null, and it stops repeating it, but i would like for it to go ...

Using jQuery AJAX to call ASP.NET function in control code-behind instead of page code-behind

I have a user control that I'm creating that is using some AJAX in jQuery. I need to call a function in the code-behind of my control, but every example I find online looks like this: $("input").click(function() { $.ajax({ type: "POST", url: "Default.aspx/GetResult", data: "{}", contentType: "applica...

How do I switch off this part of CK editor?

How do I switch off this bottom bit? Can't seem to find it in the docs, can do just about everything else... config.??? = false; Answers on a postcard boys and girls. :D ...

conditional javascript inclusion with caching in rails

Here is the situation, I use jquery for everything in my rails app with the exception of a certain action in a certain controller where I need to use prototype (for a graph gem) AND jquery for evreything else. this causes the $ conflict, which I resolve by using the jQuery.noConflict and assign $j for jquery and use $ for prototype. Ther...