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 =
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 li').each(functi
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 of
> On Mar 19, 3:40 pm, ricardobeat 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() an
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 wrote:
> Hi,
>
> Has anyone used a stable
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
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 "transla
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 wrote:
> Hi,
> Using :not() worked great.
> Cheers
> Will
>
> On Mar 18, 11:09 am, "T.J. Crowder" wrote:
>
> > Hi again,
>
> > *bl
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 =
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(){
$(this).parent
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
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 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, when
> I try to
Try this:
var body = fieldset.find('ol:first')
http://docs.jquery.com/Selectors
On Mar 17, 12:13 pm, shapper wrote:
> Hello,
>
> I am trying to find update a plugin to create new functionality.
> On the current version I have the following:
>
> var legend = fieldset.find(':first');
>
n error
>
> thanks!
> On Mar 16, 7:26 pm, ricardobeat wrote:
>
> > jQuery.fn.showLoop = function(i){
> > var i = i || 0,
> > self = this;
> > $( this[i] ).show(600, function(){
> > self.showLoop(++i);
> > });
>
> > };
>
&g
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 wrote:
> how can i loop through each div on a page and have them appear one by
> one
> i am tryin
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 wrote:
> So i upgraded to the latest version and waisted my day :(
> Seems like the dependant
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
Assuming you have this:
Something here
You'd use this javascript:
$('#dj .options tr').each(function(){
var self = $(this);
self.find(':checkbox').click(function(){
self.toggleClass('selected')
});
});
I don't know if it's possible for the click event to fire
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();
}
uot; }, 2000, function(){
animateMe();
});
})();
On Mar 14, 3:26 pm, Grom 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 wrote:
>
> >http://devthought.com/p
You can't wrap any element around s. 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 them
http://devthought.com/projects/mootools/apng/
On Mar 14, 12:29 pm, Grom 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?
try this, with the proper closing slash as you're using for :
$.each(json, function(i, item){
$('')
.attr('href', 'http://example.com')
.html('test')
.appendTo('#gallery');
});
}
On Mar 12, 4:57 pm, joshm wrote:
> In my jquery code I do:
> $.each(json, function(i, item) {
> $('
ought that you always have 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
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 $
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
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 th
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:
http://www.smashingmagazine.com/2007/07/27/css-specificity-thin
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 wrote:
>
Can't you load both products, each in it's own container, and show/
hide them? That's easier and faster.
$('#products .blue').show();
$('#products .red').hide();
etc.
On Mar 11, 11:30 am, Desinger wrote:
> Hi,
>
> Product page would like to load different contents in same di
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
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 it's
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 wrote:
> Hi all,
>
> How do i prevent my jQuery from reloading per page, but still have SEO
> fr
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 the
: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 wrote:
> H
this seems to work:
scrubbed = code.html().replace(/]*-->/gi,"");
The expression you had would eat everything between the first "". 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 wrote:
> Hey there,
>
> I'm trying to use J
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:
$('a:
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 wrote:
> Hello all,
>
> I am trying to add the values
Try
setInterval(function(){ $('#sliderotate').click(); }, 5000);
or
setInterval(EYE.spacegallery.next, 5000) // without the $ and the "s
On Mar 6, 11:39 am, Timz66 wrote:
> I am trying modify Photo gallery and I want it to rotate through the
> images, I currently use
> setInterval("document.get
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 wrote:
> Does anyone hav
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, cjhil
You're confusing :first with :first-child. :first-child means the
element must be the first child of it's parent - the never is,
that would be the . 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 of the f
You can append more than one thing at a time:
$('#clonehere').append($('.hook:first').clone(true), "Some text");
On Mar 5, 3:35 pm, bstoppel wrote:
> You're totally right. In my real code I am appending text as well as
> the cloned form.
processing 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
&g
Maybe you can use jQuery's filter method:
$(JSONObject).filter(function(){
return this.cactus = 'green' && !this.water;
});
On Mar 4, 11:00 pm, Khai wrote:
> I have a collection of DIVs (or a JSON array). Is there a javascript
> library that can search through a JSON array and return a co
Insert anywhere and use position:absolute.
On Mar 5, 8:03 am, choesang 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 I can arrive
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 a
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( elem
Oh, never noticed that funcionality, that's nice. The 'myIframe' var
is unnecessary though.
cheers,
- ricardo
On Mar 3, 3:38 pm, "Matt W." wrote:
> function getContentFromIframe(iFrameName) {
>
> var myIFrame = $("#"+iFrameName);
>
> var content = myIFrame.contents().find("body").htm
: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:
$('#tabs
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 wrote:
> Thanks for your attention
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(){
$children.hi
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 = '';
$(this).find('> .group').each(function(){
xml += '';
$(this).find('> .group').each(function(){
xml += '';
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 wrote:
> tha
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" wrote:
> I
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])
,
- ricardo
On Mar 3, 12:21 am, Nic Hubbard wrote:
> Hi Ricardo,
>
> Could you explain why you did %4 for the n variable?
>
> On Feb 26, 12:16 pm, ricardobeat wrote:
>
> > I like it cleaner:
>
> > $('a').each(function(i){
> > var n = Math.floor(i/1
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 wrote:
> That argument's been raging for
That's possible, but you'll have to take care of passing the right
context everytime:
//main page
//inside the iframe
$ = jQuery = $('iframe')[0].parent.jQuery;
$('#myElement', document); //pass the iframe's document as context
to exemplify, if you were to do this "from the outside":
//main
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 wrote:
> You're right, this what I'm doing ... I'm afraid I
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
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 principles.
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
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:
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 wrote:
> I'm using jquery 1.3.2 and trying to send some dat
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 wrote:
> Davide...
>
> Did you ever get a response.
>
> I am having a similar problem with 1.3.2 in that I have multiple area
> html statements and onl
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) {
$(thi
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 wro
t
> > > does not.
>
> > > Any suggestions? Thanks for your help, I'm fairly new to jquery.
>
> > > // Code does not work...? hmm
>
> > > $(".myButtons").click(function(){
> > > $(this).find('select').val(1);
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
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:
$('foobar')
.append('.test')
.prepend('test: ')
.appendTo('body');
http://jquery.nodn
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 windo
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){
Just remove them if you need:
$('span').text().replace('\n', '');
- ricardo
On Feb 26, 10:12 am, AdrenalineJunkie 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
> subsequently read th
What browser are you testing on? Are you using any kind of minifier/
packer?
On Feb 26, 3:46 pm, AndreMiranda wrote:
> But why (".detalhes") doesn't work and ("div .detalhes") works???
> thanks!!
>
> On 26 fev, 15:44, Eric Garside wrote:
>
> > Actually, the space is telling jquery that you want
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 wrote:
> The rows are created on the fly, they aren't actually empty. Here
uery.com
>
> > > > On Feb 24, 2009, at 8:28 AM, Stephan Veigl wrote:
>
> > > > Hi,
>
> > > > I've done some profiling on this, and $("p", $("#foo")) is faster than
> > > > $("#foo p") in both jQuery 1.2.6
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 bett
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(){
...
// 't
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 wrote:
> Hi all,
> I have a code that counts the number of
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 this.style.backgroundImage.indexOf('.png
Probably changing
$("tr #button").click(function(){...
to this
$("tr #button").click(function(){
$("select", this).html("012345");
return false;
});
Will fix it. You need to find the select element in the right context,
remember that jQuery's selectors work like CSS.
Al
$('#id')
.add(myJQObj)
.add(myotherJQObj)
.hide()
On Feb 24, 8:51 am, Bisbo 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 but neither works.
>
> $( $('#
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 raphaeljs.co
On Feb 24, 6:10 pm, Jon Sagotsky 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.
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 wrote:
> Hi guys
>
> is there a way to use logical operators in jQuery e.g. with
> 'contain
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 tha
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,
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 wrote:
> Hello,
>
> I've been working on a jquery projet (with the lastest stable version of
> jquery) that
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);
}
an
now: function(){ return (new Date()).getTime(); },
> start: function(){ this.time = this.now(); },
> since: function(){ return this.now()-this.time; }
>
> };
>
> ...and I start the timer in the last row of the last script being
> loaded...
>
> Yes, I know th
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 =
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);
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 t
$(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,
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
wrote:
> Ricardo - thanks for clarifying on the insertion.
> So... when i t
This will be easier sometime around 2012 when RGBA and HSLA colors are
widely supported :)
On Dec 12, 1:22 pm, Liam Potter wrote:
> Jim, read the question again ;)
>
> Anyway.
> There is no simple solution to this problem, I'd advise using a PNG
> image as it is the cleanest way to achieve this.
According to the API the URL is in item.link, so you just need to wrap
the image in an anchor:
function(data){
$.each(data.items, function(i,item){
$("").attr("src", item.media.m)
.appendTo("#images")
.wrap('");
if ( i == 4 ) retur
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,
Check the status in the XHR object you get back, it's probably not
successfull.
On Dec 12, 11:06 am, "Javier Martinez" wrote:
> I'm making some calls with getJSON on another domain, and the callback is
> not firing.
> My code is the next:
>
> var url =
> 'http://localhost:8080/cometd/cometd?mes
1 - 100 of 558 matches
Mail list logo