Since jQuery 1.3 you can use the live() function, so you don't need to
rebind the events.
Just set $('table caption a').live('click', addItemFinal) once in $
(document).ready() and all anchors added to the doc afterwards that
match this selector will fire the function on click.
live() uses what
I'm using Maxmind's GeoLite City open-source database. It's free and
has surprising accuracy. They also have paid webservice plans with
more precise data.
http://www.maxmind.com/app/geolitecity
cheers,
- ricardo
On Mar 19, 12:06 am, Vijay Balakrishnan bvija...@gmail.com wrote:
Hi,
Has
, 3:40 pm, ricardobeat ricardob...@gmail.com wrote:
Since jQuery 1.3 you can use the live() function, so you don't need to
rebind the events.
Just set $('table caption a').live('click', addItemFinal) once in $
(document).ready() and all anchors added to the doc afterwards that
match
All I see is a brief flash at the end of the animation, not very
noticeable, both in IE and FF. I suppose there isn't a way to avoid
that as you are removing/appending the elements. Maybe fixing the
$targetNode position with position:absolute before the after/before
call, that should avoid some
This is a bit more efficient:
$('.test1').change(function(){
var test1 = $(this).val();
var test2 = $(this).closest('li').next('li').find('select.test2').val
();
alert(Test1: +test1+and Test2: +test2);
});
Or to avoid repeating the traversal every time:
$('#idfortheUL
I guess the problem is this line:
var ac = $(#operator)[0].autocompleter.findValue();
$(..)[0] gives you the first HTML Element in the object. It's not a
jQuery object anymore, so the autocompleter property doesn't exist.
IDs should be unique so that is unneeded, try changing it to
var ac =
If you need performance, this should be it:
http://jsbin.com/uvuzi/edit
It sorts the rows using the Fisher-Yates shuffling algorithm.
Despite throwing elements around in an array, it's faster than the
pure mathematical solution because you don't need to filter out
duplicate random numbers. An
You're missing a closing parenthesis in your IF statement. Other than
that, your code works fine:
http://jsbin.com/oguqe/edit
Something else must be wrong in your page, do you have a live sample
we can look at?
It all could also be rewritten as
$('.closeEl').click(function(){
The logic is all there in the source code. You can see that all of the
fieldset's children get removed and appended to the DIV - that would
include the first OL, that's why it doesn't work. This is just another
wild guess, I can't test it:
var legend = fieldset.find(':first');
var body =
Your example is working fine for me with 1.3.2 - $('a[class!
=whatever]'). $('a[className!=whatever]') should also work.
cheers,
- ricardo
On Mar 18, 9:26 am, will mac.tas...@gmail.com wrote:
Hi,
Using :not() worked great.
Cheers
Will
On Mar 18, 11:09 am, T.J. Crowder
It's not faster, it actually adds a bit of overhead. From jQuery
source code:
// HANDLE: $(expr, $(...))
} else if ( !context || context.jquery ) {
return (context || rootjQuery).find( selector );
that means everytime you type $('.someclass', this) it's effectively
being
thanks!
On Mar 16, 7:26 pm, ricardobeat ricardob...@gmail.com wrote:
jQuery.fn.showLoop = function(i){
var i = i || 0,
self = this;
$( this[i] ).show(600, function(){
self.showLoop(++i);
});
};
$('.type').showLoop();
On Mar 16, 7:27 pm, Tom Shafer tom.sha
Try this:
var body = fieldset.find('ol:first')
http://docs.jquery.com/Selectors
On Mar 17, 12:13 pm, shapper mdmo...@gmail.com wrote:
Hello,
I am trying to find update a plugin to create new functionality.
On the current version I have the following:
var legend =
Are you using jquery.noConflict() in your app?
What do you get on console.log( jQuery.fn.corners )?
On Mar 17, 1:17 pm, boy_named_Goo ssw...@edline.com wrote:
I'm trying to use the rounded corners plugin -- jquery.corners.js .
When I create a small test case, below, it works fine. However,
Assuming you have this:
table id=dj
tbody class=options
tr
tdSomething here/td
tdinput type=checkbox //td
tr
/tbody
/table
You'd use this javascript:
$('#dj .options tr').each(function(){
var self = $(this);
self.find(':checkbox').click(function(){
You could simply use
$(window).trigger('unload')
That will unbind all events bound through jQuery. A function for doing
that is already defined in the source code:
jQuery( window ).bind( 'unload', function(){
for ( var id in jQuery.cache )
// Skip the window
Have you tried 1.3.2? A lot of selector bugs have been fixed in this
release.
Try changing it to return !!$(element.form).find(param).length and see
if it works.
- ricardo
On Mar 16, 4:30 pm, chielsen mich...@thalent.nl wrote:
So i upgraded to the latest version and waisted my day :(
Seems
jQuery.fn.showLoop = function(i){
var i = i || 0,
self = this;
$( this[i] ).show(600, function(){
self.showLoop(++i);
});
};
$('.type').showLoop();
On Mar 16, 7:27 pm, Tom Shafer tom.sha...@gmail.com wrote:
how can i loop through each div on a page and have them appear one
http://devthought.com/projects/mootools/apng/
On Mar 14, 12:29 pm, Grom grommas...@gmail.com wrote:
Hello.
I want to add flying clouds like onhttp://devthought.com/on my site.
Do anyone know how to do that? Maybe any suggestions?
You can't wrap any element around trs. Tables can only contain a
tbody/thead/tfoot and TRs, if you insert an element that is not
allowed, it itself will be wrapped by a new TR created by the browser,
and you'll get all kinds of misbehavior. You could insert a new tbody,
but browser handling of
();
});
})();
On Mar 14, 3:26 pm, Grom grommas...@gmail.com wrote:
Its not that. He wrote code to move image using mootools. Im looking
for something to move image on page for Jquery
On 14 Mar, 18:44, ricardobeat ricardob...@gmail.com wrote:
http://devthought.com/projects/mootools/apng/
On Mar 14, 12
Try this:
el.find(#pic)
.attr({src: pix[imgName].imgSrc, name: imgName})
.bind('load readystatechange', function(e){
if (this.complete || (this.readyState == 'complete' e.type =
'readystatechange')) {
el.fadeIn(slow);
$(#loading).hide();
};
});
It's not a selector. Where did you come across that?
The makes it think you want to create an element. It does
nothing more than creating a textNode that contains the string %=x.y
% (and a temporary DIV to hold it).
This $(' ') does the same. The '#' is ignored just as if you used $
('#div/')
to
select attributes with [..] or .attr(..) Is this an officially working
function?
Thanks :-)
Gerald
ricardobeat wrote:
You're returning the object you created, so that will always be true.
Return the .length property and it shoud work:
$.extend($.expr[':'],{
readonly
try this, with the proper closing slash as you're using for img/:
$.each(json, function(i, item){
$('a/')
.attr('href', 'http://example.com')
.html('test')
.appendTo('#gallery');
});
}
On Mar 12, 4:57 pm, joshm joshmat...@gmail.com wrote:
In my jquery code I do:
$.each(json,
You're returning the object you created, so that will always be true.
Return the .length property and it shoud work:
$.extend($.expr[':'],{
readonly: function(a) {
return !!$(a).filter('[readonly=true],
[readonly=]').length;
}
});
But a simpler/faster/safer alternative is the
Can't you load both products, each in it's own container, and show/
hide them? That's easier and faster.
div id=products
div class=red
/div
div class=blue style=display:none
/div
/div
$('#products .blue').show();
$('#products .red').hide();
etc.
On Mar 11, 11:30 am, Desinger
How about
$('#orderlineform #productlisting').load('orderProxy.cfm',
{
mode:'getAvailableProducts',
ordergrade_id:ordergrade_id,
order_id:order_id
},
function(){
$(this).find('#product_id').change
(isRentalActive);
});
On Mar 11, 11:19 am, Todd Rafferty
Just wrap your re-usable parts in a container with an ID. IDs have
greater weight on CSS rules, that will usually be enough. putting !
important on all your rules will bloat your code unnecessarily.
See this article on CSS specifity:
When javascript/HTML kicks in the headers have already been sent,
there is nothing you can do except offering copy paste :)
A server-side script that does it for you is not much of a burden, it
could be made very light. I think you could get the text from POST and
stream it directly without
You can keep a sitemap with the whole structure, but ideally you
shouldn't use AJAX to load whole pages in place of links. Reloading
different pages is not bad.
On Mar 10, 10:20 am, 123gotoandplay wesweatyous...@gmail.com wrote:
Hi all,
How do i prevent my jQuery from reloading per page, but
If the scripts are not present at page load they will load after ready
has already fired. You'll have to use a callback (like in JSONP) to
fire when a script has loaded. There was a posting recently about a
plugin that loads js in an iframe and uses the body onload event, but
I can't remember
Just a guess: are you defined that function inside $(document).ready
() ? If you are, it's only available inside that scope, you should
define it outside so it's declared globally. But a better approach is,
like mike said, to use proper event binding instead of inline
attributes. It's cleaner and
:not(tr[id^=review])
that says: trs which do NOT contain an id that does NOT equal
review. in other words, TRs which DO contain the word review in
it's id.
You want not contains instead: $('#replies tr[id^=r]:not
([id*=review])');
cheers,
- ricardo
On Mar 9, 1:55 am, Yansky forbo...@gmail.com
Looks great. I like how the editing works.
One thing: why are you using DIVs instead of a table? That's precisely
the only case where tables should be used, to display tabular data.
It's semantically correct and can offer performance improvements, as
table elements have native properties like
function weightTotal(){
var total = 0;
$('.weight').each(function(){
total += +$(this).val(); //if it's an empty string + == 0
});
$('#grand_total').html( total + % );
}
cheers,
- ricardo
On Mar 6, 9:58 pm, shallowman nha...@gmail.com wrote:
Hello all,
I am trying to add
You can satisfy condition 1 and 3 with this:
$('a:not([href*=javascript])[target!=_blank]')
But it's not that easy for nº 2. What is saved on the onclick
attribute is a function, not plain text. You can see the source code
of the function with the .toString() method, so you could do this:
this seems to work:
scrubbed = code.html().replace(/!--[^--]*--/gi,);
The expression you had would eat everything between the first !--
and the last --. There's probably a more elegant way to do it, but
I can't help any further.
cheers,
- ricardo
On Mar 6, 4:10 pm, Adam adamhow...@gmail.com
Try
setInterval(function(){ $('#sliderotate').click(); }, 5000);
or
setInterval(EYE.spacegallery.next, 5000) // without the $ and the s
On Mar 6, 11:39 am, Timz66 timothycrom...@hotmail.com wrote:
I am trying modify Photo gallery and I want it to rotate through the
images, I currently use
It's mostly done to improve performance. If you save the jQuery object
in a var you only need to find the element once (depending on the
selector it's an expensive operation), and then operate on that single
object. I (and other people) like to put a '$' in front of the var
name when it contains
Insert anywhere and use position:absolute.
On Mar 5, 8:03 am, choesang tchoes...@gmail.com wrote:
Hi!
I am trying to create a webpage where users can insert a pin (div) in
between the text using context menu.
My problem is that i do not know how to insert at the exact position.
Using Dom's
Maybe you can use jQuery's filter method:
$(JSONObject).filter(function(){
return this.cactus = 'green' !this.water;
});
On Mar 4, 11:00 pm, Khai khaitd...@gmail.com wrote:
I have a collection of DIVs (or a JSON array). Is there a javascript
library that can search through a JSON array
and/or time saved
by using var with elements? Especially if there is only one or two
references on a page?
Rick
-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of ricardobeat
Sent: Thursday, March 05, 2009 11:00 AM
To: jQuery (English
You can append more than one thing at a time:
$('#clonehere').append($('.hook:first').clone(true), Some textbr /
);
On Mar 5, 3:35 pm, bstoppel brett.telosstud...@gmail.com wrote:
You're totally right. In my real code I am appending text as well as
the cloned form.
You're confusing :first with :first-child. :first-child means the
element must be the first child of it's parent - the tbody never is,
that would be the thead. Also you have the .activity_date class in
your selector but .date in your HTML. From your code this is what
you need to get the content
You need to use the iframe's document as the context
$('#my_iframe').contents().find('div_im_trying_to_find').offset();
or
$('div_im_trying_to_find', $('#my_iframe')[0].contentDocument).offset
();
I'm curious to know if the dimensions methods will work on it.
- ricardo
On Mar 5, 1:50 pm,
It's a Wiki, something has broke. I edited it back to the last working
revision temporarily:
http://docs.jquery.com/UI/Effects/ClassTransitions
You should report this at the jquery-UI group for them to fix it
properly.
cheers,
- ricardo
On Mar 5, 6:26 pm, Brian Yanosik byano...@gmail.com
You can save a reference to the child elements (if they'll not change)
to avoid finding them over and over:
$(#parent).each(function(){
var $child = $(this).find('.child');
var $children = $('.child');
$(this).hover(function(){
$c.show();
},function(){
The CF loop doesn't matter, what the HTML output is like? In XHTML the
input element is self-closing (/) and the checked attribute should be
checked=checked.
If nothing else is wrong, both ways work fine: http://jsbin.com/avodi/
On Mar 4, 9:49 am, Swatchdog scott.swatch...@gmail.com wrote:
:after is used to insert generated content after an element, not to
select the next element. In your code, the :after(...) is doing
nothing, it reads as $('ul.tab-menu a').eq(index + 1) - what's working
is the index.
You don't need to save the index as it's in the scope of the function:
Oh, never noticed that funcionality, that's nice. The 'myIframe' var
is unnecessary though.
cheers,
- ricardo
On Mar 3, 3:38 pm, Matt W. propel...@gmail.com wrote:
function getContentFromIframe(iFrameName) {
var myIFrame = $(#+iFrameName);
var content =
I wouldn't call it 'corruption'. It's just a different approach. In
jQuery 'this' will always refer to the element to which the method is
being applied. And the data() function doesn't add any properties to
the element.
Any reason to not simply take advantage of scoping?
myClass = function(
http://www.w3.org/TR/html401/interact/forms.html#adef-name-FORM
This is still in use because it's the easiest/fastest way of getting
an array with the selected options server-side. There is no simpler
alternative.
- ricardo
On Mar 3, 12:53 am, mkmanning michaell...@gmail.com wrote:
That
explain why you did %4 for the n variable?
On Feb 26, 12:16 pm, ricardobeat ricardob...@gmail.com wrote:
I like it cleaner:
$('a').each(function(i){
var n = Math.floor(i/10) % 4;
$(this).addClass(
n == 0 ? 'first' :
n == 1 ? 'second' :
n == 2 ? 'third
As other's have said, you should do this server-side. Anyway, here's a
way to do it:
var csv = 'Row2,Row1,Row3',
mytable = $('#mytable')[0]; //save the table for later
csv = csv.split(','); //csv is now an array
var ln = csv.length;
while(ln--){ //loop csv array in reverse
$('#'+csv[ln])
There's not much you can convert to jQuery. It's all javascript
anyway:
function getContentFromIframe(iFrameName) {
var content = $('body', $('#'+iFrameName)[0].contentDocument).html
();
$('#myiFrame-content').append(content);
}
- ricardo
On Mar 3, 2:56 pm, Rick Faircloth
The best you can do is rewrite it to a simple ternary conditional and
use the .checked property direclty:
$(input[name^=REQ_ACCT_LAB_]).click(function() {
$(input[name=MY_CHK]).attr('checked', this.checked ?
'checked' : '');
});
cheers,
- ricardo
On Mar 3, 4:15 pm, Jael jae...@yahoo.com
Not showing your js function doesn't help much.
All .group are descendants of .map, it's not about context.
Maybe you want this (rough):
$('.map').each(function(){
var xml = 'map';
$(this).find(' .group').each(function(){
xml += 'group';
$(this).find(' .group').each(function(){
xml
That's correct, ajaxSetup only sets the defaults for every ajax call.
Use ajaxSuccess instead:
$().ajaxSuccess(function(){
//...
});
http://docs.jquery.com/Ajax/ajaxSuccess#callback
cheers,
- ricardo
On Mar 2, 12:08 pm, creemorian creemor...@gmail.com wrote:
You're right, this what I'm
That's possible, but you'll have to take care of passing the right
context everytime:
//main page
script type=text/javascript src=jquery.js/script
//inside the iframe
script
$ = jQuery = $('iframe')[0].parent.jQuery;
$('#myElement', document); //pass the iframe's document as context
/script
to
Yes we are! You're not only talking about the low percentage of
browsers with JS off, but more important mobile browsers which don't
have full support for javascript. That's a big market.
Besides that, using pure CSS is faster, simpler, less prone to errors
and follows the unobtrusive
Not sure what this is an answer too (appear as a new subject), but:
$(img:not(this))
You have 'this' as a string in there. That's saying give me all
images which are not a 'this' element. Should be this:
$(img).not(this) //passing the actual DOM element to not()
I prefer to code it this way:
Two other ways:
$('tr.className + tr').each(function(){
var nxt = $(this), i=0;
while (nxt.length){
nxt.css('backgroundColor', i%2 ? 'white' : 'red');
nxt = n.next(':not(.className)');
i++;
}
});
Or this (I prefer the first, this one is probably slower):
$('tr.className
That's because the animations don't wait. Add the css() to the last
element's animation callback
function nexthour(object, start, stop) {
var $guide = $(#guide),
$divs = $('div.bla'),
ln = divs.length;
$guide.css('height', $guide.height());
$divs.each(function(index) {
It's hard to tell without seeing the HTML code.
Works fine here: http://jquery.nodnod.net/cases/196
- ricardo
On Feb 27, 2:02 pm, RandyJohnson ra...@srpropertiesllc.net wrote:
Davide...
Did you ever get a response.
I am having a similar problem with 1.3.2 in that I have multiple area
Where are you expecting to collect the response? Are you using a
callback?
function check_out_image(image_id) {
$.post('ajax/checkout_image', {imageid: image_id}, function(resp){
alert(resp);
});
}
On Feb 27, 2:41 pm, Dan tribaldr...@gmail.com wrote:
I'm using jquery 1.3.2 and
You can do that with pure CSS:
http://jsbin.com/eyivu
http://jsbin.com/eyivu/edit
with jQuery:
$('#menu li a').hover(function(){
$(this).stop()
.css({ backgroundColor: '#C66' })
.animate({ marginLeft: '+=5px' }, 200);
}, function(){
$(this).stop()
.css({ backgroundColor:
What browser are you testing on? Are you using any kind of minifier/
packer?
On Feb 26, 3:46 pm, AndreMiranda acymira...@gmail.com wrote:
But why (.detalhes) doesn't work and (div .detalhes) works???
thanks!!
On 26 fev, 15:44, Eric Garside gars...@gmail.com wrote:
Actually, the space is
Just remove them if you need:
$('span').text().replace('\n', '');
- ricardo
On Feb 26, 10:12 am, AdrenalineJunkie jason.h...@gmail.com wrote:
Im building a form parser(plugin) that will build a json object to a specific
design. One problem I am having involves how I render some html and
I like it cleaner:
$('a').each(function(i){
var n = Math.floor(i/10) % 4;
$(this).addClass(
n == 0 ? 'first' :
n == 1 ? 'second' :
n == 2 ? 'third' :
n == 3 ? 'fourth' : '');
});
or
var classNames = ['first', 'second', 'third', 'fourth'];
$('a').each(function(i){
In jQuery's core the *local* variable window is being set. You're
trying to rewrite the global variable 'window' that already exists.
You can only set a var named 'window' in a scope that is not the
global one, like this:
function giveMeChocolate(){
var window = this;
//this == the global
after() will insert elements 'after' the selected elements in the DOM.
If the element is not in the DOM, that is kind of 'outer space', there
is no 'after' it. Append and prepend should work just fine:
$('pfoo/ppbar/p')
.append('b.test/b')
.prepend('spantest: /span')
.appendTo('body');
What are you trying to select (html)?
You're asking for all *odd* td's that are children of the rows.
Indexes in JS start at 0, so the first element is odd. Maybe what you
want is this:
$('#tab1 tr:gt(0)td:nth-child(2n)') or $('#tab1 tr:gt(0)td:even')
If you actually want the odd ones except
).click(function(){
$(this).find('select').val(1); //this will select the option
with
value == 1
});
});
On Feb 24, 11:25 pm, ricardobeat ricardob...@gmail.com wrote:
Probably changing
$(tr #button).click(function(){...
to this
$(tr #button
This should be a little bit faster:
var $divB = ('.divB', '#wrapper');
$('#divA').children('.a-specific-class').appendTo($divB[0]);
If it's possible, try moving a single wrapper element containing all
the links, that will be certainly faster.
- ricardo
On Feb 26, 8:40 pm, Jack Killpatrick
This will give you all DIVs which have background-image set:
$('div').filter(function(){
return !!this.style.backgroundImage;
})
If you need to filter by extension or something use indexOf, it's
faster than a regex:
$('div').filter(function(){
return
Tables have native properties which are much faster to access:
$('#myTable')[0].rows.length //number of rows
$('#myTable')[0].tBodies[0].rows.length //number of rows in the first
tbody
cheers,
- ricardo
On Feb 25, 5:25 am, Alex Wibowo alexwib...@gmail.com wrote:
Hi all,
I have a code that
Define the functions in the appropriate scope (either global or inside
the function passed to ready). Functions are executed in the scope
they are called, so you write them like they were already inside the
click handler.
$(document).ready(function() {
function yourAjaxFunction(){
...
//
According to John Resig $.browser will remain for the foreseeable
future. Being deprecated doesn't mean it will be removed soon (or at
all). If you're targeting IE6 quirks I'd think it's not that bad to
keep using browser detection, but if you're using it to differentiate
modern browsers it's
it as scope for further selects.
by(e)
Stephan
2009/2/23 ricardobeat ricardob...@gmail.com:
up to jQuery 1.2.6 that's how the selector engine worked (from the top
down/left to right). The approach used in Sizzle (bottom up/right to
left) has both benefits and downsides
There must be something else wrong in your page. The HTML and
selectors you gave work fine (see http://jquery.nodnod.net/cases/175).
Can you put a complete sample page online?
- ricardo
On Feb 25, 8:52 pm, RadicalBender radicalben...@gmail.com wrote:
The rows are created on the fly, they
On Feb 24, 6:10 pm, Jon Sagotsky sagot...@gmail.com wrote:
Just to clarify, $(p, #foo) would be meaningless
That's not true. $('p', '#foo') has the exact same result as $('p', $
('#foo')), the context is executed just as well.
Java applets have a bit slow loading time, and afaik it can't interact
with the rest of the page.
Using iecanvas.js you would have to write a single code (compliant
with the canvas specs) that would work for both IE and FF - but the
support in IE might not be complete.
have you seen
$('#id')
.add(myJQObj)
.add(myotherJQObj)
.hide()
On Feb 24, 8:51 am, Bisbo michael.waterf...@googlemail.com wrote:
Hi there,
I can't seem to find a way to perform the same jQuery method on
multiple jQuery objects. I have tried using commas and passing arrays
to the jQuery function
Probably changing
$(tr #button).click(function(){...
to this
$(tr #button).click(function(){
$(select, this).html(option0/optionoption
selected='selected'1/
optionoption2/optionoption3/optionoption4/
optionoption5/option);
return false;
});
Will fix it. You need to find
up to jQuery 1.2.6 that's how the selector engine worked (from the top
down/left to right). The approach used in Sizzle (bottom up/right to
left) has both benefits and downsides - it can be much faster on large
DOMs and some situations, but slower on short queries. I'm sure
someone can explain
This should work, but it's an inclusive or (unlike an if/else where
only one possibility is choosen)
$('.myclass').filter(':contains(one), :contains(two), :contains
(three)')
On Feb 23, 8:33 am, ggerri a...@ggerri.com wrote:
Hi guys
is there a way to use logical operators in jQuery e.g. with
being
loaded...
Yes, I know there are many ways to improve and optimize my methods,
BUT that's not my main issue right now, becuse any improvment like the
one Ricardobeat suggests still ends up with less speed in 1.3.1 vs
1.2.6.
Thanks,
/Johan
It seems you have a misunderstanding here. $(data).text() will get you
the innerText/textContent of all the nodes in your XML, it's not
converting the whole response back to text.
Are you sending the response as 'text/xml' from the server?
add
complete: function(xhr){
console.log(xhr);
}
set cache: false in your $.ajax call to disable cacheing of responses.
You can also add a random query parameter to the URL if that doesn't
work.
- ricardo
On Feb 20, 8:53 am, Jsbeginner jsbegin...@monarobase.net wrote:
Hello,
I've been working on a jquery projet (with the lastest stable
Your function looks fine. The URL given does not exist.
jQuery(function($){
$(#carousel)
.html( $(#holder_images).html() )
.carousel3d({
control: 'continuous',
radiusY: 0,
speed: 1,
radiusX: 250,
Yeah, the browser will try to fix the mark-up you insert. You can't
just treat HTML as text unless you are actually building a string for
inserting via html/append.
cheers,
- ricardo
On Feb 19, 10:16 pm, Charlie Griefer charlie.grie...@gmail.com
wrote:
Ricardo - thanks for clarifying on the
$(this+ ' li')
'this' is an HTML Element (each LI) and you're trying to concatenate
it with a string. That should be
$(this).find('li').length or
$('li', this).length
Note that the list items are not direct children of this (the parent
LI), so don't use the ''.
cheers,
- ricardo
On Feb 19,
You could use a recursive function:
var intervals = $('.interval'), n = 0;
var setDates = function(){
intervals.eq(n).doStuff(); //intervals.eq(n) is the current element
in the loop
n++;
$.post(..., function(){
//...
if (intervals[n])
setDates(); //re-run the function with
No idea about the performance drop, but you can improve your main
function:
// MAIN
function getMenuItems(menu) {
var menuItems = [];
$(menu).find('.MenuItem').each(function(){
var t = $(this), item = false;
if (t.hasClass('processMenuItem')) item = getProcessMenuItem
(this);
dang. accidentally pressed send while writing, please ignore my last
message.
No idea about the performance drop, but you can improve your main
function. $(this)[0] is unnecessary, you're creating a new jQuery
object and throwing it away.
// MAIN
function getMenuItems(menu) {
var menuItems =
And in case you wanted to remove the class only from the label
elements *with* that ID form you would use
$('#quiz label[id*=fb]').removeClass('qyes');
that's plenty of help, isn't it? :)
On Dec 12, 2:25 am, Bruce MacKay b.mac...@massey.ac.nz wrote:
Hello folks,
I want to remove a css class
There are other alternatives:
1. Store everything as an object in data()
$(element).data('yourdata',{mydata1:'something,
mydata2:'something'})
var data = $(element).data('yourdata');
$(element).data('yourdata', $.extend(data, { mydata3:'something' });
Then you can iterate over that
Check the status in the XHR object you get back, it's probably not
successfull.
On Dec 12, 11:06 am, Javier Martinez ecentin...@gmail.com wrote:
I'm making some calls with getJSON on another domain, and the callback is
not firing.
My code is the next:
var url =
Do you have a test page we can look at?
nextAll returns an empty object if there is no 'next', but it doesn't
interrupt the chain, there may be something else going on. I couldn't
reproduce your situation here, nextAll().andSelf() returns me the
original element.
- ricardo
On Dec 12, 10:39 am,
1 - 100 of 551 matches
Mail list logo