Re: [jQuery] Sound

2009-11-05 Thread Erik Beeson
No jQuery necessarily needed for this. Plenty of information here: http://www.google.com/search?q=html+embed+audio --Erik On Thu, Nov 5, 2009 at 3:04 PM, shapper mdmo...@gmail.com wrote: Hello, Is it possible to have a music on a HTML page with two buttons to play/ stop? Can I use JQuery

Spam increase (WAS: Re: [jQuery] Re: XXX hot sexy banned movie XXX)

2009-09-29 Thread Erik Beeson
Some of my servers are seeing a lot more DDoS type traffic and I'm seeing a lot more spam across all of the mailing lists that I'm on. It's seeming like something is going on. --Erik On Tue, Sep 29, 2009 at 4:09 PM, Mike Alsup mal...@gmail.com wrote: Sigh..   this message was *not* sent by

[jQuery] Re: Synchronous call in JQuery?

2009-09-28 Thread Erik Beeson
Your question doesn't make very much sense. In your example, doSomething2 would execute after doSomething1 finished, so it is synchronous. Perhaps you could provide an example of what you're actually trying to do? --Erik On Mon, Sep 28, 2009 at 6:24 AM, Mesquite koen.buekenh...@gmail.com

[jQuery] Re: Web Application GUI's

2009-08-14 Thread Erik Beeson
I do 2 kinds of webapps: very rich (or heavy) desktop-replacement type apps, for which I generally use EXT, and much lighter, javascript-optional type websites, for which I generally buy a template from ThemeForrest. --Erik On Fri, Aug 14, 2009 at 1:15 PM, Meroe whme...@gmail.com wrote: Hello

[jQuery] Re: Need help cuz I don't get 'this'

2009-06-14 Thread Erik Beeson
Like MorningZ said, more info would be helpful, but this should work: $('#output').html('SRC: ' + $(this).children('img').attr('src')); --Erik On Sun, Jun 14, 2009 at 7:02 AM, Logictrap dlyck...@gmail.com wrote: I need to get the src attribute of an img element that is a sub- element of

[jQuery] Re: Wait for one function to finish, then start the next....

2009-05-24 Thread Erik Beeson
As you've probably found, there is no sleep/wait/pause in JavaScript. The whole system is single-threaded, so any sort of sleep would hose the whole system. Your original statement doesn't actually make sense. As it is, function2 *doesn't* execute until open_popup returns, so that isn't really

[jQuery] Re: Count how many checkboxes are checked

2009-04-15 Thread Erik Beeson
categoryList.is(':checked') will return false if none are checked, so you could do: heading.css('color', categoryList.is(':checked') ? 'red' : 'black'); --Erik On Wed, Apr 15, 2009 at 8:33 AM, Dragon-Fly999 dragon-fly...@hotmail.comwrote: Hi, I'm new to JQuery and I have a question about

[jQuery] Re: Difference between .bind() and .click()

2009-04-06 Thread Erik Beeson
But slower by 1 function call 1 time. I'd call that negligible unless you're developing for a pocket watch. --Erik On Mon, Apr 6, 2009 at 5:08 PM, James james.gp@gmail.com wrote: Not really. hover is theoretically just a very tad bit slower because internally, hover is calling

[jQuery] Re: jQuery.com homepage News from the jQuery Blog not up to date?!

2009-03-11 Thread Erik Beeson
I'm seeing this too. Quite sure it's not a cache problem on my end as I've never visited jquery.com on this browser before. --Erik On Wed, Mar 11, 2009 at 2:56 PM, MarcusT marcu...@gmail.com wrote: The jQuery.com homepage's currently shows jQuery 1.3.1 Released as the most recent

[jQuery] Re: Using jQuery.noConflict() with Prototype/Scriptaculous

2009-01-06 Thread Erik Beeson
The only thing I might guess is to do jQuery.noConflict() immediately after loading jQuery, before loading any other scripts. --Erik On Tue, Jan 6, 2009 at 8:04 PM, Magnificent imightbewrongbutidontthin...@gmail.com wrote: Hello all, I'm trying to incorporate jquery into pages with

[jQuery] Re: Is this code legitimate?

2008-12-23 Thread Erik Beeson
Using an attribute selector to select by class isn't ideal. Maybe try: $(':input.required') --Erik On Tue, Dec 23, 2008 at 5:52 PM, Rick Faircloth r...@whitestonemedia.comwrote: Is this legit? $(':input[class$=required]') I know it'll work for a div: $('div[class$=required]') but it

[jQuery] Re: if ($(#field).val() == '') or something more elegant?

2008-12-06 Thread Erik Beeson
Maybe try: if($('#text').is(':empty')) --Erik On Sat, Dec 6, 2008 at 2:12 PM, Costaud [EMAIL PROTECTED] wrote: Hello, I'm wondering if this is the correct way of checking whether the textbox is empty or not: if ($(#text).val() == '') Thanks.

[jQuery] Re: if ($(#field).val() == '') or something more elegant?

2008-12-06 Thread Erik Beeson
Whoops, that matches has no children. I think what you did is fine. --Erik On Sat, Dec 6, 2008 at 3:56 PM, Costaud [EMAIL PROTECTED] wrote: That is always saying the field is empty. On Dec 6, 5:24 pm, Erik Beeson [EMAIL PROTECTED] wrote: Maybe try: if($('#text').is(':empty')) --Erik

[jQuery] Re: passing 'this' into getjson callback

2008-12-05 Thread Erik Beeson
I think anonymous functions are much easier to read and understand. They also make scoping a bit cleaner. You can rewrite with named functions if it makes sense for your application. This is untested, but should be close to what you're asking: jQuery( '#myButton' ).bind( 'click', function() {

[jQuery] Re: document.getElementById shortcut?

2008-11-23 Thread Erik Beeson
jQuery isn't a replacement for javascript. If you want document.getElementById, use it. If you want a shorter name, shortcut it yourself. If you want to get the DOM node out of a jQuery object, use $(...)[0] --Erik On Sun, Nov 23, 2008 at 9:34 PM, George [EMAIL PROTECTED] wrote: I found myself

[jQuery] Re: How can I return some value in jquery's callback function?

2008-11-13 Thread Erik Beeson
I'm not quite understanding you, but it seems like you need to just pass along callback functions? Maybe you want something like: function checkRegistered(email, doIfRegistered, doIfNotRegistered) { var url='http://localhost/coudou/check/register.php?email=' + email;

[jQuery] Re: JSLitmus invaluable tool

2008-11-11 Thread Erik Beeson
With Normalize checked, I get infinity for both of them. With it unchecked, I get 12.6M and 10.9M. I'm using google chrome (which the test reports as Safari). --Erik On Tue, Nov 11, 2008 at 9:16 AM, howardk [EMAIL PROTECTED] wrote: I've been experimenting with several different coding styles

[jQuery] Re: unsubscribe

2008-11-03 Thread Erik Beeson
http://www.google.com/search?q=google+groups+unsubscribe On Mon, Nov 3, 2008 at 9:59 AM, Minal Patki [EMAIL PROTECTED] wrote: I do not wish to recieve any emails from this group. Thanks

[jQuery] Re: Help optimising jquery code - there must be a better way

2008-10-21 Thread Erik Beeson
I don't have time to rewrite your whole example, but I can offer a few tips that might help. Selecting by class alone can be pretty slow. Basically every single tag has to be checked for the class every time you do a selection by class. It would help to at least give the HTML tag that the class is

[jQuery] Re: id same as name confuses JQuery?

2008-10-13 Thread Erik Beeson
I assume your use of braces instead of parenthesis is just a typo? I am unable to reproduce this. This works for me: $('body').append('div id=foobar name=foobar.../div'); $('#foobar').size(); // 1 Could you provide a sample page? --Erik On Mon, Oct 13, 2008 at 1:30 PM, Tim Scott [EMAIL

[jQuery] Re: Animate backgroundColor?

2008-10-10 Thread Erik Beeson
A google search for jquery animate color will lead you to the color plugin, which will do what you want. --Erik On Thu, Oct 9, 2008 at 9:43 PM, Jimbo M [EMAIL PROTECTED] wrote: I'm fresh and green to jQuery and enjoying it immensely. One thing I'm used to doing in AJAX is to animate a

[jQuery] Re: OT : javascript editor (with code formatting)

2008-10-07 Thread Erik Beeson
Not free, and probably not what you're looking for, but I can't recommend IntelliJ IDEA enough. Among a lot of other things, it has great JavaScript support with syntax highlighting, refactoring, code completion, and reformatting. --Erik On Tue, Oct 7, 2008 at 8:13 AM, Alexandre Plennevaux

[jQuery] Re: XML Parsing Question...

2008-10-06 Thread Erik Beeson
To my knowledge, XML parsing via the jQuery constructor isn't supported. See here: http://dev.jquery.com/ticket/3143 --Erik On Sat, Oct 4, 2008 at 12:29 PM, KenLG [EMAIL PROTECTED] wrote: For much of my app, I'm doing an Ajax hit to the server to grab XML. That works great. But, in some

[jQuery] Re: Possible to set metadata parameter dynamically?

2008-10-06 Thread Erik Beeson
In an older version of the metadata plugin, you used to be able to set something (metaDone to false I think it was) that would force it to reload, but that doesn't work anymore. This is all untested, but here's my read on it: Now, metadata is stored in jQuery's internal caching system, which

[jQuery] Re: XHTML Selector Nightmare

2008-10-01 Thread Erik Beeson
Try this: $('.sMarker ~ row', myTable).not($('.eMarker ~ row', myTable)) That will get what you want, but I think it won't include the .sMarker row. To get .sMarker also, maybe try: $('.sMarker,.sMarker ~ row', myTable).not($('.eMarker ~ row', myTable)) You can also do it by index without

[jQuery] Re: unsubscribe

2008-10-01 Thread Erik Beeson
Perhaps you're looking for: http://groups.google.com/group/jquery-en/subscribe --Erik On Wed, Oct 1, 2008 at 4:18 PM, Steve Schnable [EMAIL PROTECTED] wrote: unsubscribe!

[jQuery] Re: Metadata parameter as selector

2008-09-29 Thread Erik Beeson
The previous responses don't seem to get that you're using the metadata plugin. I would suggest using filter: $('tr').filter(function() { return $(this).metadata().id == 4; })... If you find yourself doing that a lot, you can add a custom selector for metadata. Something like:

[jQuery] Re: Case Insentitive Selectorys

2008-09-22 Thread Erik Beeson
Maybe try using filter and a regexp for the part that you want to be case insensitive. Something like (very untested): $(...).find('item').filter(function() { return this.name.match(new RegExp(search, 'i')); }).each(function() { }); I don't recall the syntax for accessing an XML attribute from

[jQuery] Re: Insert variable into a selector

2008-09-22 Thread Erik Beeson
According to the docs, 'this' within a success callback is the options object, so 'this.id' doesn't mean anything useful: http://docs.jquery.com/Ajax/jQuery.ajax#options Also, $(this.id) probably isn't anything useful either. Maybe try this (untested): $('.makeFavorite').click(function() {

[jQuery] Re: Anyone know where to ask jQuery questions?

2008-09-05 Thread Erik Beeson
It's only been 4 hours since your original thread. Seems awfully quick to already be complaining about a lack of response. I looked at your thread and had no idea why XML parsing wouldn't work. I guess I had never come across that before. I didn't respond because I didn't know, and I didn't look

[jQuery] Re: New Google Browser announced

2008-09-04 Thread Erik Beeson
However, as Google mentions themselves, if your website is compatible with Safari 3 it should autmatically also be compatible with the current Chrome version. Sort of. It's not an issues of a new renderer to support (WebKit, same as Safari/Android), it's an issue of a new JavaScript engine

[jQuery] Coverflow

2008-09-04 Thread Erik Beeson
No association with jQuery, but here's a nice JavaScript coverflow effect that I thought people might like: http://radnan.public.iastate.edu/coverflow/ It mucks around with extending builtin objects, which is bad form to us jQuerians, but it's a nice effect. --Erik

[jQuery] Re: Cross domain problems

2008-07-24 Thread Erik Beeson
'; JK -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Erik Beeson Sent: Wednesday, July 09, 2008 9:33 AM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Cross domain problems The protocol *must* be the same

[jQuery] Re: array method on a jQuery object: deleting, adding elements

2008-07-12 Thread Erik Beeson
Check out the functions here, particularly under Filtering: http://docs.jquery.com/Traversing --Erik On 7/12/08, wolf [EMAIL PROTECTED] wrote: hi all, since a jQuery collection (say, `var j = $( 'div' )`) looks and behaves a bit like a standard javascript array (you can iterate over

[jQuery] Re: Cross domain problems

2008-07-09 Thread Erik Beeson
issue. I always solve this problem this way: Eg.: To ajax this:http://feedproxy.feedburner.com/undergoogle I create this:http://blog.alexsandro.com.br/application/load/feedproxy.feedburner.c... -- Alexsandrowww.alexsandro.com.br On 9 jul, 00:18, Erik Beeson [EMAIL

[jQuery] Re: Cross domain problems

2008-07-08 Thread Erik Beeson
Add this somewhere in your javascript: document.domain = 'site.com'; Google document domain --Erik On 7/8/08, flycast [EMAIL PROTECTED] wrote: Simple problem (I think)... I am new to JS and ajax. I am building an ajax capability on a clients site. I am running into cross domain

[jQuery] Re: Need truncator/Expander help (trimming on # of objects rather than character count)

2008-07-06 Thread Erik Beeson
Seems to have some HTML escaping issues on your options page: http://plugins.learningjquery.com/summarize/index.html#options At least in Safari. --Erik On 7/6/08, Karl Swedberg [EMAIL PROTECTED] wrote: sorry, but I'm changing the name from summarizer (with an r) to summarize. Seems to

[jQuery] Re: Why (function($){ ...})(jQuery) instead of (function(){var $ = jQuery; ...})()?

2008-07-04 Thread Erik Beeson
On Fri, Jul 4, 2008 at 7:29 AM, Ariel Flesler [EMAIL PROTECTED] wrote: Note that the (function($){ ... })(jQuery); approach is 6 bytes shorter than (function(){ var $ = jQuery; })(); It also looks cooler ;) These were exactly the points I was going to make. Since $ is really a utility

[jQuery] Re: Passing a variable into the $('selector') function

2008-07-02 Thread Erik Beeson
If msg is '#myDiv' and you have element with id=myDiv, then $(msg) will select it. If you think that's what you're doing and it isn't working for you, either your id is wrong or msg doesn't hold what you think (maybe it has a trailing \n?). --Erik On 7/2/08, Stompfrog [EMAIL PROTECTED] wrote:

[jQuery] Re: Position cursor at end of textbox?

2008-07-02 Thread Erik Beeson
Ick! Global variables and eval'd code! How about (untested, logic should be unchanged): $(function() { $(':text').bind('focus', function() { var o = this; if(o.setSelectionRange) { /* DOM */ setTimeout(function()

[jQuery] Re: Position cursor at end of textbox?

2008-07-02 Thread Erik Beeson
, 8:12 pm, Erik Beeson [EMAIL PROTECTED] wrote: Ick! Global variables and eval'd code! How about (untested, logic should be unchanged): $(function() { $(':text').bind('focus', function() { var o = this; if(o.setSelectionRange) { /* DOM

[jQuery] Re: SproutCore vs jQuery? Are there any comparisons out there?

2008-06-17 Thread Erik Beeson
I guess maybe it'll be cool eventually since Apple is apparently backing it? But from the demos so far, it looks extremely half-baked... --Erik On 6/17/08, Andy Matthews [EMAIL PROTECTED] wrote: Yeah...that's what I thought. I've never even heard of it before WWDC. -Original

[jQuery] Re: Is there a way to use the css function with $(document) directly?

2008-06-16 Thread Erik Beeson
This worked for me on FF2/Mac: $('style/style').attr('type', 'text/css').text('div { background: red; }').appendTo('head'); --Erik On 6/16/08, Brian J. Fink [EMAIL PROTECTED] wrote: I didn't mean $(element).css(object), I meant $ (document).css(selector,rule). The difference is this:

[jQuery] Re: $(#content).load('http://www.google.com.br') is a possible ?

2008-04-24 Thread Erik Beeson
Use an iframe or read up on cross domain ajax. --Erik On Thu, Apr 24, 2008 at 1:27 PM, Luciano Mazzetto [EMAIL PROTECTED] wrote: Hi, I need loading http request inside my div content. I do this it $(#content).load(http://www.google.com.br;); but i hadn't sucess How i can load this

[jQuery] Re: Which jQuery method to use in this scenario

2008-04-23 Thread Erik Beeson
The formSerialize function from the form plugin does exactly what you're asking for: http://www.malsup.com/jquery/form/#api The form plugin also has a variety of functions for submitting forms via ajax. Hope it helps. --Erik On 4/23/08, neualex [EMAIL PROTECTED] wrote: Guys, I am new with

[jQuery] Re: Focus First 'visible' field

2008-04-22 Thread Erik Beeson
Your inner $(this).filter(...) doesn't make sense to me. This works for me on FF2/Mac: $(':input:visible').filter(function() { return $(this).parents(':hidden').length == 0; }).slice(0,1).focus(); That is: Select all visible inputs elements, filter out any who have parents which are

[jQuery] Re: What do you use?

2008-04-17 Thread Erik Beeson
Java. See also, this thread: http://groups.google.com/group/jquery-en/browse_thread/thread/ce0ddf8919cb9334/2613d125f737387d --Erik On Wed, Apr 16, 2008 at 4:31 AM, Chalkers [EMAIL PROTECTED] wrote: Hi jQueryers, I am curious what people use as on the server side with jQuery? PHP, ASP,

[jQuery] Re: Find a exact location in the dom, then move down from that location to another element

2008-04-10 Thread Erik Beeson
I'm not quite sure what you're asking for, but it sounds like you might want to check out the docs on selecting and traversing: http://docs.jquery.com/Selectors http://docs.jquery.com/Traversing Hope it helps. --Erik On 4/10/08, sleepwalker [EMAIL PROTECTED] wrote: Is there a way in jquery

[jQuery] Re: Is there an Event.stop for hrefs?

2008-04-06 Thread Erik Beeson
Returning false is fine, but there's also event.preventDefault(): http://docs.jquery.com/Events_%28Guide%29#event.preventDefault.28__.29 $('a').click(function(e) { e.preventDefault(); }); --Erik On 4/6/08, Michael Sharman [EMAIL PROTECTED] wrote: Hi guys, I am listening for an href click

[jQuery] Re: jEditable issue in Firefox 2.0.0.13

2008-04-05 Thread Erik Beeson
(and is jEditable the best edit-in-place plugin for jQuery anyway?) Yes.

[jQuery] Re: check/uncheck via toggle

2008-04-02 Thread Erik Beeson
Also, '[EMAIL PROTECTED]' can be replaced with ':checkbox'. --Erik On 4/2/08, Karl Rudd [EMAIL PROTECTED] wrote: The toggle() function is used to hide and show items, nothing to do with clicking or changing of state. http://docs.jquery.com/Effects/toggle What you want is something like:

[jQuery] Re: missing ( before formal parameters

2008-03-05 Thread Erik Beeson
missing ( before formal parameters $(#postcode).change(function{$(#town).val(zipToCityHash.$(#postcode).val()... Also, I see what you're trying to do there, but you can't access object properties like that. You probably want something like: $(#postcode).change(function() {

[jQuery] Re: Attribute Selector

2008-02-25 Thread Erik Beeson
You have some oddly mismatched quotes, but otherwise, yes, that works. Here's a test done in firebug on jquery.com: $('[EMAIL PROTECTED]:][href*=book]').each(function() { console.log(this.href );}); http://www.packtpub.com/jQuery/book/mid/1004077zztq0

[jQuery] Re: what editor do you use?

2008-02-13 Thread Erik Beeson
IntelliJ IDEA and gvim. I use gvim literally all the time. I have an icon on my dock for Open with gvim that I can just drop files on. Very handy. The nice thing about gvim (or vi in general I guess), is that while there are a lot of commands, way more than anyone would be expected to learn all

[jQuery] Re: Counting DIVs with class x within a larger DIV

2008-02-12 Thread Erik Beeson
Untested, but should work: $('#data .x').length --Erik On 2/12/08, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, Sure this is simple, still trying to get a handle on the basics of JQuery. Given a DIV with id = data, how would I count the number of DIVs with class = x, within the larger

[jQuery] Re: How to logically AND selectors?

2008-01-30 Thread Erik Beeson
Generally, just run them together with no space. A div tag with ID foo and class bar: div#foo.bar Any tag with classes class1 and class2: .class1.class2 etc Hope it helps. --Erik On 1/30/08, Kynn Jones [EMAIL PROTECTED] wrote: Hi. The docs describe selectors of the form selector1,

[jQuery] Re: How to logically AND selectors?

2008-01-30 Thread Erik Beeson
You're looking for:.selector1.selector2.selector3 But, that's only if selector1, selector2, and selector3 are all classes, yes? --Erik

[jQuery] Re: how to get php to detect if it's an ajax call or a normal full page call

2008-01-29 Thread Erik Beeson
The request header X-Requested-With is set to XMLHttpRequest for all AJAX calls from jQuery. Hope it helps. --Erik On 1/29/08, Alexandre Plennevaux [EMAIL PROTECTED] wrote: Hello, so that my php script can serve both ajax calls and full page call if javascript is not available on the

[jQuery] Re: Feb 12 IE6 Forced Update

2008-01-24 Thread Erik Beeson
I don't usually run both at the same time, but I have, and it works. I'm on a 2GHz Core 2 Duo iMac with 3GB of RAM (the most it will take). I use both Parallels and Fusion because I started with Parallels, and it has more features, but it's more resource intensive, so for things like video

[jQuery] Re: animation queue ?

2008-01-17 Thread Erik Beeson
Check out here: http://erikandcolleen.com/erik/jquery/fxQueue/ Demo: http://erikandcolleen.com/erik/jquery/fxQueue/random.html Or here: http://brandonaaron.net/jquery/plugins/fxqueue/ Demo: http://brandonaaron.net/jquery/plugins/fxqueue/test/test.html --Erik On 1/17/08, Alexandre Plennevaux

[jQuery] Re: a way to convert jquery object to text for dom injection

2008-01-14 Thread Erik Beeson
Maybe try (untested): $('div').append('text blab bla').append($('#d')).append('ok nana'); --Erik On 1/13/08, Equand [EMAIL PROTECTED] wrote: i need to insert a clone of one dom object i do var hex = $(#d).clone(); $(div).append(text blab bla+hex+ok nana); and it's not working... how do

[jQuery] Re: Sorting with each()

2008-01-14 Thread Erik Beeson
I seem to be the only person to care about sort in jQuery. This ticket has a sort function that worked with 1.1, though I'm not sure if it still does. Make sure to scroll down to the bottom for the most recent version: http://dev.jquery.com/ticket/255 For example, to sort the children of an

[jQuery] Re: jQuery 1.1.2 Released: Happy 2nd Birthday!

2008-01-14 Thread Erik Beeson
I thought I was having a flashback as I swear I remembered 1.1.2 being released a while ago: http://jquery.com/blog/2007/02/27/jquery-112/ Ahh, a typo I see. At least it's right in the blog. Congrats! Keep up the awesome work. --Erik On 1/14/08, John Resig [EMAIL PROTECTED] wrote: On the

[jQuery] Re: [ANNOUNCE] Cornerz - Bullet Proof Curved Corners using Canvas/VML

2008-01-08 Thread Erik Beeson
Your choice of colors aside, this plugin looks fantastic! Very smooth. If this had gradients and drop shadows, I could replace my photoshop guy with it :) --Erik On 1/7/08, weepy [EMAIL PROTECTED] wrote: Hi I'd like to announce my latest jQuery plugin. I hope you'll find it useful.

[jQuery] Re: Select elements in order

2007-12-24 Thread Erik Beeson
See my responses regarding this issue in this thread: http://groups.google.com/group/jquery-en/browse_thread/thread/c21d5c20bfd25f6c/f42894299920f05d?lnk=gst --Erik On 12/24/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: I want to select some items on my page in the order they appear, but

[jQuery] Re: (this).next problem

2007-12-24 Thread Erik Beeson
Siblings are tags who have the same parent. For example: foobar.../barfar.../far/foowax.../wax bar and far are siblings, foo and wax are siblings, far and wax aren't siblings. Maybe try this: $('.collapse_device').click(function() { $(this).parents('.device_header').next().hide(); }); That

[jQuery] Re: clicking on row vs. clicking on link in that row

2007-12-22 Thread Erik Beeson
While returning false will stop the event from propagating, it will also prevent the default action from occurring, which isn't necessarily desirable. In this case it might not matter, but in general, event.stopPropagation() is the right way to stop the event from propagating. Returning false does

[jQuery] Re: creating own callback

2007-12-21 Thread Erik Beeson
I doubt that will work. There need not be anything particularly jQueryish about preloading images, but if you want to stick it under $, maybe something like: jQuery.extend({ preloadImage: function(imagePath,callback) { var image = new Image();

[jQuery] Re: clicking on row vs. clicking on link in that row

2007-12-21 Thread Erik Beeson
Maybe try: // hide a row after acknowledgement $(#myTable a.ackn).click( function(e){ e.stopPropagation(); $(this).parents('tr').hide(); }); See also: http://docs.jquery.com/Events_(Guide)#event.stopPropagation.28__.29 --Erik On 12/21/07,

[jQuery] Re: Plugin for code highlighting and row numbering?

2007-12-20 Thread Erik Beeson
Chili is probably your best bet. I whipped up a little example that does a little post processing to add line numbers: http://erikandcolleen.com/erik/projects/jquery/chililineno/ There might already be an option for it in Chili, and there's probably a smother way to apply it than I'm doing, but

[jQuery] Re: Stupid little game :)

2007-12-19 Thread Erik Beeson
Fun, thanks for sharing :) --Erik On 12/19/07, Stefan Petre [EMAIL PROTECTED] wrote: Hi, I did a small game (it was a test for a client), about 6kb of code. http://www.eyecon.ro/slotmachine/ Stefan

[jQuery] Re: animation: sequential showing / hiding : how-to?

2007-12-17 Thread Erik Beeson
A google search for jquery fxqueue also turns up these: http://erikandcolleen.com/erik/jquery/fxQueue/ http://brandonaaron.net/jquery/plugins/fxqueue/ Not sure if they'll work with newer versions of jQuery, but maybe worth checking out. --Erik On 12/17/07, pixeline [EMAIL PROTECTED] wrote:

[jQuery] Re: Shared variables, events, and namespaces...

2007-12-13 Thread Erik Beeson
If you're just looking to keep from polluting the global namespace, you can wrap all of your code in a closure. Lots of info here: http://www.google.com/search?q=javascript+closures For example (untested): (function() { var ele = '#foo'; $(document).ready(function() { $(ele). // ...

[jQuery] Re: Cross domain photo gallery using get().

2007-12-08 Thread Erik Beeson
Hi Andy, Neat idea. What you want for remote data is JSONP, which just requires that your server produce a chunk of javascript that calls a function with a specified name and passes in your data as a JSON block. So instead of generating an HTML fragment, your data.cfm would take a parameter

[jQuery] Re: A 5 line script that doesn't work in IE

2007-12-01 Thread Erik Beeson
To check if an element has a particular class: $(...).is('.theClass'); To add a class to an element: $(...).addClass('theClass'); To remove a class: $(...).removeClass('theClass'); See also: http://docs.jquery.com/Traversing/is#expr http://docs.jquery.com/Attributes/addClass#class

[jQuery] Re: Passing extra data to AJAX handler functions

2007-11-27 Thread Erik Beeson
You could wrap your real callback in an anonymous function that adds the parameters that you want. Maybe something like (untested): $.post('/ajax/asset/insert', { folder_tid : lastUploadedFolderTID, link : linkQueue[id] }, function(data, status) {

[jQuery] DateJS: Robust Date manipulation library

2007-11-27 Thread Erik Beeson
Hello all, This came through my feed reader this morning, and I thought it looked like the kind of thing jQuerians might enjoy: http://www.datejs.com/ It's a Date library with lots of parsing capabilities and jQuery style chainable syntactic sugar. It's ~25k minified (!), so it's probably not

[jQuery] Re: $('.class1,.class2').filter(':first') always finds first .class1

2007-11-05 Thread Erik Beeson
Your issue doesn't actually have anything to do with the filter, it's the selection. $('.class1,.class2') selects all class1, then all class2. So even if class2 appears before class1, class one will still get selected first (since you specified it first in the selector), and your filter will

[jQuery] Re: $('.class1,.class2').filter(':first') always finds first .class1

2007-11-05 Thread Erik Beeson
Your issue doesn't actually have anything to do with the filter, it's the selection. $('.class1,.class2') selects all class1, then all class2. This totally explains why I have the issue, and I thank you for describing it. I expected the select element statement to behave something

[jQuery] Moo based Calendar widget

2007-11-05 Thread Erik Beeson
Here's a very slick calendar widget built on mootools: http://moomonth.com/ Demo here: http://moomonth.com/demo/index.html It looks like it also has a number of handy additions to the Date object that might be useful outside of mootools: http://moomonth.com/docs/index.html --Erik

[jQuery] Re: Alternatives to dom ready() for running Jquery code

2007-11-01 Thread Erik Beeson
Move your javascript to the bottom of the page, right before /body, or use $(window).load(...) instead, if you can handle your javascript not running until all of your external resources (read: images) have loaded. I think this should be fixed soon. --Erik On 11/1/07, Brett [EMAIL PROTECTED]

[jQuery] Re: limit to only jpeg when file upload

2007-10-31 Thread Erik Beeson
Untested: form method=POST action=... input id=file name=file type=file /form $('form').bind('submit', function() { var ext = $('#file').val().split('.').slice(-1).toLowerCase(); if(ext != 'jpg' ext != 'jpeg') { alert('JPEG Only'); return false; } }); --Erik On 10/31/07,

[jQuery] Re: .attr(type,hidden)

2007-10-29 Thread Erik Beeson
See also, this thread: http://groups.google.com/group/jquery-en/browse_thread/thread/b1e3421d00104f17/88b1ff6cab469c39 --Erik On 10/29/07, Robert O'Rourke [EMAIL PROTECTED] wrote: Hi, does $(some selector).attr(type,hidden) work for anyone? I'm getting this in firebug: [Exception...

[jQuery] Re: jquery plugin + problem with return for this element

2007-10-25 Thread Erik Beeson
Despite the fact that you code is a bit of a mess, your problem is just that since you aren't defining the variable callback with var callback = ..., it's being made a global variable, and as a global variable, each time you call $(...).test1(...), you're overwriting callback. Same for ttt. Adding

[jQuery] Re: Gotcha in the ajax call

2007-10-21 Thread Erik Beeson
That parameter is added when you set the 'cache' property to false. Are you doing that? --Erik On 10/21/07, M. A. Sridhar [EMAIL PROTECTED] wrote: When making a GET call via jQuery.ajax, jQuery 1.2.1 adds a URL parameter named '_' (the single underscore character) whose value is the

[jQuery] Re: prevent checkbox to check when click

2007-10-19 Thread Erik Beeson
: is that different if I use .click() instead of .bind()? because it doesn't work for me thanks On Oct 19, 1:57 pm, Erik Beeson [EMAIL PROTECTED] wrote: Just return false from a click handler. The box will be focused, which will change the way it looks a little, so you may also want to blur

[jQuery] Re: Case-insensitive version of :contains(text) ?

2007-10-19 Thread Erik Beeson
You could add your own expression for it (tested on FF2/Mac): jQuery.extend(jQuery.expr[':'], { containsIgnoreCase: (a.textContent||a.innerText||jQuery (a).text()||'').toLowerCase().indexOf((m[3]||'').toLowerCase())=0 }); Usage: $('...:containsIgnoreCase(foo)'); Or you could use a filter

[jQuery] Re: How to suck web content from an iframe to a div

2007-10-19 Thread Erik Beeson
IIRC, sub-domains can also be made to work if all pages involved set the same document.domain But back to the OP, your iframe can deal with scrolling itself if you set its size in the containing page, and that you can do cross-domain. Maybe I don't quite get what you're trying to do... --Erik

[jQuery] Re: prevent checkbox to check when click

2007-10-18 Thread Erik Beeson
Just return false from a click handler. The box will be focused, which will change the way it looks a little, so you may also want to blur it. Something like: $(':checkbox').bind('click', function() { this.blur(); return false; }); Tested on FF2/Mac. --Erik On 10/18/07, james_027 [EMAIL

[jQuery] Re: filter not working when expression contains spaces

2007-09-27 Thread Erik Beeson
This is the expected behavior. The selector '.myClass a' describes an A tag being a descendant of a tag with the class myClass. is() doesn't work on a relationship as the result is ambiguous. To check if this element is an A tag that is a descendant of of a tag with class myClass, maybe try:

[jQuery] Re: Aaron Gustafson has a great ALA-Article on (Content-)Image Alignment and Consistency

2007-09-27 Thread Erik Beeson
Is there a reason you didn't replace this.getElementsByTagName? --Erik On 9/27/07, Remy Sharp [EMAIL PROTECTED] wrote: If you're talking about the If I Told You You Had a Beautiful Figure... article, here you go: function FigureHandler(g, h) { if (typeof(h) !== 'object') { var h

[jQuery] Re: functions after $.get work strange

2007-09-27 Thread Erik Beeson
$.get is asynchronous, meaning the call to $.get returns immediately, even before the callback has happened. To answer your specific question, setting a variable who's scope is outside the callback is as easy as defining the variable outside the callback: var foo; $.get(..., function() { foo =

[jQuery] Re: Toggling a checkbox

2007-09-27 Thread Erik Beeson
To check or uncheck a checkbox, assign true or false to its 'checked' property (untested): $('#myCheckbox')[0].checked = true; or $('#myCheckbox').attr('checked', true); But it looks like you're trying to enable/disable them, in which case you probably want $(...).attr('disabled', 'disabled');

[jQuery] Re: Alternative syntax?

2007-09-27 Thread Erik Beeson
You'll learn to love anonymous functions. And eventually, you'll even learn to love closures: (function($) { // do something })(jQuery); I guess cleanliness is relative. It looks pretty clean to me. The goal of anonymous functions is to be able to pass around chunks of code to be executed

[jQuery] Re: OT Changing S=style sheet with javascript or jquery?

2007-09-27 Thread Erik Beeson
A google search for 'jQuery stylesheet switcher' turns up: http://kelvinluck.com/article/switch-stylesheets-with-jquery --Erik On 9/27/07, Eridius [EMAIL PROTECTED] wrote: http://demo.sugarondemand.com/sugarcrm_os/index.php?action=indexmodule=Home if you click on the blocks of color at

[jQuery] Re: Attribute renaming

2007-09-26 Thread Erik Beeson
[EMAIL PROTECTED] wrote: I am trying to rename the ids and name attributes On Sep 26, 10:06 am, Erik Beeson [EMAIL PROTECTED] wrote: What are you trying to accomplish? --Erik On 9/26/07, voltron [EMAIL PROTECTED] wrote: I have tags like this: select id=academic_from_month

[jQuery] Re: Attribute renaming

2007-09-26 Thread Erik Beeson
name=color input name=house /dv div name= container1 input name=color1 input name=house1 /dv ans so forth Thanks On Sep 26, 12:57 pm, Erik Beeson [EMAIL PROTECTED] wrote: Rename them from what to what? To change the id of all selects, you can do: $('select').each(function

[jQuery] Re: Using .children recursively

2007-09-26 Thread Erik Beeson
This will find all descendants: $(this).find('*'); --Erik On 9/26/07, voltron [EMAIL PROTECTED] wrote: I am trying to get all the children of a node, apart from adding .children() for every generation, is there one call that gets all recursively? this is what I´m doing at the moment

[jQuery] Re: Parent Child Selectors + bind

2007-09-26 Thread Erik Beeson
Also, your initial selector can be simplified to: $(#id1 :text) --Erik On 9/26/07, Remy Sharp [EMAIL PROTECTED] wrote: You're binding to 'onfocus' when it should be 'focus': $(#id1 [EMAIL PROTECTED]).bind(focus, foo); On Sep 26, 8:35 am, Anjanesh [EMAIL PROTECTED] wrote: Hi I

[jQuery] Re: cannot retrieve elements with xpath

2007-09-26 Thread Erik Beeson
If you're using jQuery 1.2 or later, you need the XPath plugin. See here: http://docs.jquery.com/Release:jQuery_1.2#XPath_Compatibility_Plugin --Erik On 9/26/07, julio [EMAIL PROTECTED] wrote: it doesn't work for me. I have used $(function() { and $(document).ready(function() { but

  1   2   3   4   >