jquery

jQuery navigating the dom with Each and Nth Child.

I'm trying to navigate through each of the tr element and select the 5th td element then store the value in it. What am I doing wrong? $("table tbody tr td tbody tr:nth-child(4)").each(function (i) { alert(this.text); }); <table> <tbody> <tr> <td align="center"><table cellpadding="2" style="border: 2px solid rgb(208, 208, 208)...

jquery selectors

I would like to select the p elements inside a particular div, #homepage. I know how to select all the #homepage, or all of the li's on the page, but how do I selected a nested group of li's? Thank you! ...

JQuery .click() doesn't work on HTML added to DOM using .after() ?

I have added HTML to my page using the .after() method using HTML that is retrieved from a .GET() 'Ajax' call. I have a button in my retrieved HTML and an event that is set to be triggered when this button is clicked. However the method that handles the .click event is never triggered. When I put the same button into my 'normal' html ho...

dynamically setting properties in uploadify

is it possible to add a new property to a previously declared object? Here is some code to clarify (with the uploadify jquery plugin): $('#featuredimageupload').uploadify({ 'uploader' : base_url + 'media/js/uploadify.swf', 'script': base_url + 'post/uploadflash', 'multi' : true, 'queueID' : 'queue', ...

Dynamic options object for jQuery plugin (examples of)

Is anyone aware of any jQuery plugins that can work with a dynamic options object? What I mean is, I need to be able to pass in: $('div').somePlugin({title : 'title1', label : function(element){}, etc.}); and also $('div').somePlugin({name : 'name1', url : function(element){}, event : 'event1', etc.}); So the ...

Live updates using JQuery?

At the moment, I have a Javascript (JQuery) front-end which periodically makes requests to a seperate, PHP script which returns posts. For the sake of efficiency, however, I'd like to simply add new results to the array, not even looking at existing posts. As it stands, I've attempted to do so with times (i.e. "SELECT * FROM table WHER...

Where to form html when using asp.net mvc and jquery?

I am currently working on some prototypes for a web site I am wanting to create. Part of the web site is going to be pretty heavy with javascript. Right now I am learning the jquery and ASP.Net MVC framework combo. The issue I am having is where I should be forming the html generated for ajax requests. For example on page load I want ...

replace in jQuery

Hi Can some one help me in this I had a variable var myValue = "what is you name? what is your age?" i want to find the '?' in the string and replace it with a html input text element where the user can enter the answer in the text box and at last i need a string as out put like this "what is your name my name is xyz what is your...

How to select an object if it contains a number with jquery?

Hi there, I have a couple divs like so: <div>1</div> <div>2</div all the way through to <div>11</div> <div>12</div> And so on. What I'm wanting is a jquery select that picks one of these, like so: $('.ticketNumber:contains("1")').addClass('something'); The problem with this of course, is its going to select any of the divs tha...

If element exists, do X (jQuery)

I currently do this to check if an elements exists: if ($(".element1").length > 0 || $(".element2").length > 0 { ...stuff... } Is there a better way to rewrite the same? I mean, ".length" the same as ".length > 0" ? Thanks ...

jQuery POST/AJAX not showing up in IE, works in FF

I've done my homework and scoured SO to no avail. I've even gone from $.post to $.ajax in an effort to clean out everything. There's no cacheing either. $('#send').click(function() { $.ajax({ url: "submit.php?ts="+new Date().getMilliseconds(), cache: false, type: 'POST', dataType: 'text', data: $("#myform")...

Twitter Search Results - API / Atom Feed

So I've got somewhat of a cool task and I'm just thinking it over. I'm more a designer so I thought I'd tap into the bright minds on here. I am creating a basic page that displays the results from a twitter search results page. Put simply, I am displaying an atom feed with HTML. I'd like to do it with PHP, unless someone has something b...

Jquery accordion activate

I'm not getting how to do this, or if I can do this. I have an accordion, multiple sections with each section containing multiple anchor tags each with a unique string id. I'd like to be able to have the accordion open to where a particular element with a given id is. Like say id "item117". Can I use something like $('#accordion').acti...

Jquery Count Divs with class name

Seems pretty simple but I cant get it to work. If I have two divs with the class of 'user' I want to output 'you have 2 divs' <script type="text/javascript"> $(document).ready(function() { function divcount() { var mycount = $('.user').length(); document.write(mycount) } }); </script> I'm sure im mi...

jQuery sorting problem in datatables with anchor tag

I used the jQuery datatable plugin in sort the table data. The sorting works fine if a column contains simple text. If I put any anchor tag condition on a text then the column sorting does not sort properly. I displayed the values in following manner: <td><?php if ($allAptArr[$d][27]['staffinactive'] == 1) { ?> <?=ucwords(str...

jQuery Form Callback Compatibility Issue

I have a form on my website (http://www.jakelazaroff.com/#contact) that I submit with jQuery. The callback function for when the form is successfully submitted is supposed to make the form fade away; however, for some reason this only works on certain browser/OS combinations. Right now, the compatibility list is as follows: WORKS o f...

ajaxify multipart encoded form (upload forms)

is there a way to do this? I'm not looking for an alternative plugin (like FancyUpload or Uploadify), I just want to know how I can ajaxify the submission of an upload form. ...

Extended function jquery

I have a function that looks like this: jQuery.fn.menuFunc = function( settings ) { settings = jQuery.extend({ actionAddURL:"", actionModifyURL:"", ........ },settings);}; where all the parameters i initialize (actionAddURL, actionModifyURL, etc..) are strings (ids of different elements...

JQuery vs. Prototype

Hi Guys, I am about to begin a project that requires an amount of JS. I was having trouble deciding what JS library / framework would fit best. So I thought I would float the question here. Specifically, which of your favorite features does one framework implement which the other one loses out on? Are there any conceptual reasons why y...

jQuery and Django - append()

Hi there I am trying to append my JSON data to a div. For some reason I am not seeing, it does not append. The data is collected correctly from Django view, I can see this is the FireBug console. Here is my JS $.getJSON('/chat/xhr_test/', function(response_array) { var arr = response_array; $.each(arr, function(count, item) {...