[jQuery] Re: Iterating over 1000 items - optimizing jquery

2007-08-21 Thread Erik Beeson
need to work through yours though, to cut the timing down, as it's still taking a while. If you have any further thoughts, though let me know... Thanks, Dan. On 8/21/07, Erik Beeson [EMAIL PROTECTED] wrote: heh, I took so long writing my reply, a bunch of other people replied

[jQuery] Re: Creating DOM elements on the fly

2007-08-17 Thread Erik Beeson
The jQuery function $() can parse HTML, as can the various DOM functions (append, prepend, appendTo, etc): $('input id=foo type=text/').appendTo('#myForm'); --Erik On 8/16/07, Anurag [EMAIL PROTECTED] wrote: Hi, I am a jQuery beginner. I am working on an application for which I need to

[jQuery] Re: jQuery negatives: dual/triple/quadruple special-case uses for both function calls and method names

2007-08-17 Thread Erik Beeson
$(p:gt(4)).show().gt(10).css(color,red); Or, if you need to operate multiple time on same collection: var my_coll = $(p); my_coll.gt(3).css(color,red); my_coll.lt(3).css(color,blue); This stuff cannot be done by solely in selector expression. I'm pretty sure this can be done with

[jQuery] Re: Creating DOM elements on the fly

2007-08-17 Thread Erik Beeson
You don't really want multiple fields with the same ID though, do you? I think .clone() will help you: function MakeEmailField(n) { var inputBox = $('input').attr(type, text); for (i =0; i n; i++) { inputBox.clone().attr(id,email+i).appendTo('#myForm'); } } The initial

[jQuery] Re: Creating DOM elements on the fly

2007-08-17 Thread Erik Beeson
).appendTo('#myForm'); } $inputBox.attr(id,email+n).appendTo('#myForm'); } Noticed the loop starting value is different. This way, the cloning only happens if you want more than one, which is a little more efficient. --Erik On 8/17/07, Erik Beeson [EMAIL PROTECTED] wrote: You don't

[jQuery] Re: Creating DOM elements on the fly

2007-08-17 Thread Erik Beeson
I have to remember that a variable is a node in the DOM tree. Does that mean that when it initially created, it is hidden? Not quite. When you create a DOM node from scratch, it exists in memory, but not as a part of the DOM (that is, the collection of DOM nodes that make up the page), and

[jQuery] Re: Creating DOM elements on the fly

2007-08-17 Thread Erik Beeson
=email4/ input type=text id=email5 name=email5/ /form And it doesn't break the usual usage of appendTo or chainability. --Erik On 8/17/07, Pops [EMAIL PROTECTED] wrote: On Aug 17, 4:30 am, Erik Beeson [EMAIL PROTECTED] wrote: Actually, technically, what I suggested wastes the original node

[jQuery] Re: Creating DOM elements on the fly

2007-08-17 Thread Erik Beeson
for the plug-in. I have to study it! -- HLS On Aug 17, 5:43 am, Erik Beeson [EMAIL PROTECTED] wrote: If you find yourself doing this kind of thing a lot, it might be handy to turn it into a plugin (totally off the top of my head and untested): (function($) { var _appendTo

[jQuery] Re: True overlay?

2007-08-16 Thread Erik Beeson
You can load an iframe in jqModal. --Erik On 8/16/07, howa [EMAIL PROTECTED] wrote: Hello, I am looking for a plugin for loading external page into a overlay like jqModal does, but when I click on the link in the overlay, I only want the overlay's content to be changed. Are there such

[jQuery] Re: JSON String problem

2007-08-16 Thread Erik Beeson
Yep, that's a feature of JavaScript. No quotes means it's a number, not a string, and numbers that start with 0 are assumed to be octal (base 8). Even parseInt(063) will give you 51, since again, it assumes you mean octal. I suggest you either strip of the leading zero on the server side, and

[jQuery] Re: JSON String problem

2007-08-16 Thread Erik Beeson
JSON is just a text format. {foo: 'Bar'} *is* JSON. It sounds like the trouble you're having is related to how your JSON is being generated, which is an issue with your server side, not your client side. Out of curiosity, how are you generating your JSON? --Erik On 8/16/07, Terry B [EMAIL

[jQuery] Re: Function Outside Bound Event

2007-08-16 Thread Erik Beeson
What doesn't work about it? Is the venueSwap function getting called? Is the showMe function getting called? Are there any JavaScript errors in firebug? Are you calling venueSwap(randomVenue) from within a $(document).ready() callback? --Erik On 8/16/07, AJ [EMAIL PROTECTED] wrote: Hopefully

[jQuery] Re: stupid dev tricks: gzipping jQuery without mod_deflate

2007-08-16 Thread Erik Beeson
serving. On Aug 15, 2:32 pm, Erik Beeson [EMAIL PROTECTED] wrote: I cache the packed versions. Actually, I concatenate all of the scripts that I need for a page, minify them (used to use packer, now I use YUImin), and then cache that, all on the fly. So I have one script tag like: script type

[jQuery] Re: Basic JSON help

2007-08-16 Thread Erik Beeson
I'm not quite sure which part you're asking about. To get and interact with your example data, you could do something like: $.getJSON('/url/to/json', function(data) { for(var i = 0; i data.models.length; i++) { $('#output').append('div' + data.models[i] + '/div'); // or whatever you want

[jQuery] Re: JSON String problem

2007-08-16 Thread Erik Beeson
Deserializing JSON in JavaScript is as simple as running the code: eval(jsonString); While that's correct, you probably want to stick said deserialized object somewhere: eval('var json = ' + jsonString); console.log(json); Or some such. --Erik

[jQuery] Re: how to call selected object inside function calling

2007-08-16 Thread Erik Beeson
'this', in the context of your handler function, is the DOM node that triggered the event. You probably want something like: function delete_photo() { var url = this.href; // or $(this).attr('href'); ... } $('.delete_photo').bind('click', delete_photo); Usually this kind of thing is written

[jQuery] Re: Basic JSON help

2007-08-16 Thread Erik Beeson
Right, 'count' doesn't have any special meaning that I know of. What are you expecting it to be? Arrays have a special property called length, which you could access like json.models.length, but Objects (like your json variable), don't necessarily have this special property. --Erik On 8/16/07,

[jQuery] Re: JSON String problem

2007-08-16 Thread Erik Beeson
Yep. I ran into a similar problem with an XSL stylesheet that did XML to JSON conversion. I ended up ripping out all of the numeric detection stuff and just kept it all strings so I could deal with it reliably on the JavaScript side. Glad you got it worked out. --Erik On 8/16/07, Terry B

[jQuery] Re: Documentation on $('#foo')[0] or $('#foo').get(0) ??

2007-08-16 Thread Erik Beeson
The point is to get the first DOM node, so you'd still need to do [0], which would still throw an error if there was no match. If you're not certain that there'll be a match, maybe something like this would be safer: var $foo = $('#foo'); if($foo.length 0) { var foo = $foo[0]; } else { //

[jQuery] Re: Function Outside Bound Event

2007-08-16 Thread Erik Beeson
Awesome, glad it worked out. --Erik On 8/16/07, AJ [EMAIL PROTECTED] wrote: Called the javascript function from Flash, and that seems to be the best fix. Thanks!

[jQuery] Re: Basic JSON help

2007-08-16 Thread Erik Beeson
I assumed he was using $.getJSON or something similar that takes care of the eval'ing for you. --Erik On 8/16/07, Michael Geary [EMAIL PROTECTED] wrote: From: jeff w I am new to jQuery, and have started to play with JSON,but I need some info about how I refer to the JSON Object once

[jQuery] Re: Basic JSON help

2007-08-16 Thread Erik Beeson
are elementary, I'm just trying to build some sort of foundation of basic concepts. On Aug 16, 10:51 am, Erik Beeson [EMAIL PROTECTED] wrote: I assumed he was using $.getJSON or something similar that takes care of the eval'ing for you. --Erik On 8/16/07, Michael Geary [EMAIL PROTECTED

[jQuery] Re: How to select element id that contains [] chars

2007-08-16 Thread Erik Beeson
Try: $('#scheduleHours\\[' + dayNum + '\\]') I think you need 1.1.3 for escaping to work right... --Erik On 8/16/07, Stuart [EMAIL PROTECTED] wrote: I've got a little problem here that would seem simple to sort out but has been rather stubborn. I'm trying to loop through a bunch of hidden

[jQuery] Re: form ID is messed up if an element in the form is named id

2007-08-16 Thread Erik Beeson
Right. That's how JavaScript works, and it's by design. When you have: form id=form_id class=form_class input type=text name=childID class=text_class id=text_id value=my name is ID / /form And you do: var formDOM = $('#form_id')[0]; Then formDOM.id will be form_id and formDOM.childID will be

[jQuery] Re: how does jQuery's timeout used?

2007-08-16 Thread Erik Beeson
I guess the timeout just means it will stop trying to complete the request. I've never actually tried to use it. To get an alert like you want, you might try using your own timer (untested): var ajax_timeout; $.ajax({ ..., beforeSend: function() { ajax_timeout = setTimeout(function() {

[jQuery] Re: Documentation on $('#foo')[0] or $('#foo').get(0) ??

2007-08-15 Thread Erik Beeson
var a = $(...); var b = a.length; a.XXX(); var c = a.get(0); Now, 'a' is a jQuery object that contains all of the elements that matched the selector. 'b' is the number of elements found. The third line is calling a jQuery function or plugin on the jQuery object that is wrapping the selected

[jQuery] Re: How do I bind this into the DOM?

2007-08-15 Thread Erik Beeson
You may want to return false; at the end of your click handler function that you bind to #pendingUsers a so that the link won't be followed. --Erik On 8/14/07, Steve Finkelstein [EMAIL PROTECTED] wrote: Hi all, This is a rather complicated issue, for a novice at least. I have HTML that

[jQuery] Re: How to test if plugin X is loaded ?

2007-08-15 Thread Erik Beeson
to do that ? What would be the reason/risk of doing it ? X+ On Aug 15, 1:09 am, Erik Beeson [EMAIL PROTECTED] wrote: I question whether or not you really want to be doing that... But here's both questions in one go: if(!$.isFunction($.fn['pluginName'])) { $.getScript('/path/to/plugin

[jQuery] Re: Interface Drag/Drop Animation

2007-08-15 Thread Erik Beeson
This just came up a week ago, too. Here's the previous thread that offers a few solutions: http://groups.google.com/group/jquery-en/browse_thread/thread/44bb914d6c8718d2 --Erik On 8/15/07, Collin Allen [EMAIL PROTECTED] wrote: Quick question about the Interface Drag+Drop methods: When I

[jQuery] Re: ORing selectors

2007-08-15 Thread Erik Beeson
For the record, that's documented here: http://docs.jquery.com/DOM/Traversing/Selectors#CSS_Selectors --Erik On 8/15/07, Erik Beeson [EMAIL PROTECTED] wrote: $('#X,.Y') --Erik On 8/15/07, rickdog [EMAIL PROTECTED] wrote: What is the cleanest way for ORing select results, e.g

[jQuery] Re: n00b question on $().clone

2007-08-15 Thread Erik Beeson
Yes, I suggest you have unique IDs. Maybe something like (untested): olli id=item1.../lili id=item2.../li/ol Then on drop do something like: var newId = 'sort_list_' + drag.id; if($('#' + newId).length == 0) { // doesn't exist in this list yet $(drag).clone().attr('id', newId).appendTo(this);

[jQuery] Re: ORing selectors

2007-08-15 Thread Erik Beeson
$('#X,.Y') --Erik On 8/15/07, rickdog [EMAIL PROTECTED] wrote: What is the cleanest way for ORing select results, e.g. returning all DIVs with id=X or class=Y?

[jQuery] Re: stupid dev tricks: gzipping jQuery without mod_deflate

2007-08-15 Thread Erik Beeson
I cache the packed versions. Actually, I concatenate all of the scripts that I need for a page, minify them (used to use packer, now I use YUImin), and then cache that, all on the fly. So I have one script tag like: script type=text/javascript src=/myscriptmerger/dimensions.js,sort.js,

[jQuery] Re: Delayed ready configuration

2007-08-15 Thread Erik Beeson
You might try moving your opening animations to $(window).load(function() {...}); --Erik On 8/15/07, Larry Garfield [EMAIL PROTECTED] wrote: Good insert time of day here jQuery. I have a site where I have a series of animations that need to run on load. I also have a large number of

[jQuery] Re: Documentation on $('#foo')[0] or $('#foo').get(0) ??

2007-08-15 Thread Erik Beeson
id is supposed to be unique is it not? My example used the # to refer to a unique id on the page, therefore *not* an array of objects. Wrong, it *is* still an array of objects, it's just an array of length 1. Do console.log($('#foo')) and you'll see that it is still an array, and an array with

[jQuery] Re: stupid dev tricks: gzipping jQuery without mod_deflate

2007-08-15 Thread Erik Beeson
. But thanks for pointing it out for those dealing with a shared hosting environment. --Erik On 8/15/07, Stephan Beal [EMAIL PROTECTED] wrote: On Aug 15, 11:32 pm, Erik Beeson [EMAIL PROTECTED] wrote: I cache the packed versions. Actually, I concatenate all of the scripts that I need for a page

[jQuery] Re: Documentation on $('#foo')[0] or $('#foo').get(0) ??

2007-08-15 Thread Erik Beeson
On Aug 16, 11:27 am, Erik Beeson [EMAIL PROTECTED] wrote: id is supposed to be unique is it not? My example used the # to refer to a unique id on the page, therefore *not* an array of objects. Wrong, it *is* still an array of objects, it's just an array of length 1. Do console.log($('#foo

[jQuery] Re: Documentation on $('#foo')[0] or $('#foo').get(0) ??

2007-08-15 Thread Erik Beeson
')[0].size; $('#foo')[0].type; to me, though maybe the method name of dom() is not the most clear and or explicit. It is short though :) pd On Aug 16, 11:27 am, Erik Beeson [EMAIL PROTECTED] wrote: id is supposed to be unique is it not? My example used the # to refer to a unique id

[jQuery] Re: caption supported?

2007-08-15 Thread Erik Beeson
jQuery: doing shady trickery so you don't have to. --Erik On 8/15/07, John Resig [EMAIL PROTECTED] wrote: That being said, we have to do a lot of shady trickery to make table-related things work properly. @Benjamin: You should file a bug on this: http://dev.jquery.com/ --John On

[jQuery] Re: How to test if plugin X is loaded ?

2007-08-14 Thread Erik Beeson
I question whether or not you really want to be doing that... But here's both questions in one go: if(!$.isFunction($.fn['pluginName'])) { $.getScript('/path/to/plugin', function() { alert('Plugin ready'); }); } else { alert('Plugin ready'); } That assumes the plugin is on the same

[jQuery] jQuery for JavaScript programmers

2007-08-14 Thread Erik Beeson
Here's a really nice jQuery introduction that starts at the beginning and goes all the way through plugin development. It looks pretty thorough: http://simonwillison.net/2007/Aug/15/jquery/ --Erik

[jQuery] Java integration

2007-08-11 Thread Erik Beeson
This was mentioned on another thread, and there were at least 2 other people interested in it, so I think it warrants its own thread. What are people's thoughts on some sort of jQuery integration with Java on the server side? This is exactly the setup my company runs, and we'd be interested in

[jQuery] Re: jQuery Zen Garden Interface

2007-08-08 Thread Erik Beeson
There is a weird glitch in FF2/Mac. The left scrolling pane works properly with the mouse wheel, but the scroll bar looks like it's making content in the background scroll. The content that is supposed to scroll doesn't move when using the scroll bar. It works correctly in Safari/Mac. Otherwise,

[jQuery] Re: Draggable - change revert after start and before stop

2007-08-08 Thread Erik Beeson
I had done this, but now I'm using a modified version of Interface, so I can't quite remember which parts require the modifications. Like Richard said, creating a new Draggable is definitely not what you want to do. I suggest you try: $(...).Droppable({ ..., onHover: function(drag) {

[jQuery] Re: Iframe events for local pages

2007-08-08 Thread Erik Beeson
To get elements by tag name in jQuery, do $('tagName') Also, I suggest you do feature detection instead of browser detection, as described here: http://www.quirksmode.org/js/support.html What I mean is, try something like this: var frame = $('iframe')[0]; var frameDocument;

[jQuery] Re: jQuery 1.1.3.1 Safari Crashes

2007-08-07 Thread Erik Beeson
Is it happening with packed version only? From Mike Chabot's original email: I performed my tests with both the packed version and the unpacked version. The packed version caused the browser to crash more quickly. With the unpacked version, I sometimes had to refresh the browser window a

[jQuery] Re: Two IE6/7 issues: clone() creating DOM element

2007-08-07 Thread Erik Beeson
In IE6/7, some things just don't work correctly if an element isn't in the DOM. Most of these issues are based upon visual aspects of the element. Also, the cloneNode method in IE 6/7 also has some issues (see http://192.168.1.70/working/jquery/cloneNode_issue.htm ) Is that URL a typo, or do

[jQuery] Re: Making periodical calls per Ajax?

2007-08-07 Thread Erik Beeson
There is a jHeartbeat plugin, but it hasn't been updated in a while, so who knows how well it works now. You might use it to get you started though. Also, you might want to look into the JavaScript functions setInterval and setTimeout. --Erik On 8/7/07, voltron [EMAIL PROTECTED] wrote:

[jQuery] Re: Iframe events for local pages

2007-08-07 Thread Erik Beeson
You probably won't be able to get events to propagate up out of the iframe, but you can have event handlers in the iframe that call out to functions in the main page. Something like (untested): main.html: script ... function handleEventFromIFrame(e) { alert('Got an event from the iframe: ' +

[jQuery] Re: Convert Text to Int

2007-08-07 Thread Erik Beeson
Because parseInt('$7.95') is not a number. Perhaps you want: var price = '$7.95'; var priceFloat = parseFloat(price.substring(1)); --Erik On 8/7/07, cfdvlpr [EMAIL PROTECTED] wrote: Here's my faulty code: var temp parseInt($('td#totalPriceData_1').text()); alert(temp); Here's what my

[jQuery] Re: Turning a checkbox on and off

2007-08-06 Thread Erik Beeson
$('your_selector').removeAttr('checked') will also work, which personally seems more intuitive to me. --Erik On 8/5/07, Marshall Salinger [EMAIL PROTECTED] wrote: That is a strange find. I wouldn't have thought to test a different string outside of the html spec for setting it to checked. I

[jQuery] Re: Ext 1.1

2007-08-05 Thread Erik Beeson
I just use the most recent form and dimensions plugins and things seem to work alright. --Erik On 8/4/07, John Resig [EMAIL PROTECTED] wrote: That updating is left to the Ext team - it's not clear why they didn't update the attached plugins. --John On 8/4/07, Jon Ege Ronnenberg [EMAIL

[jQuery] Re: $.clone

2007-08-05 Thread Erik Beeson
Thanks for sharing this. I'm pretty sure what you suggest won't properly deal with arrays. Objects aren't the same as arrays. Here's how I do something like that: function deepCopy(obj) { if(obj obj.constructor == Object) { var newObj = new Object(); for(var field

[jQuery] Re: problems with .css()

2007-08-05 Thread Erik Beeson
I'm surprised this isn't addressed in the Docs for CSS or in the FAQ. I think this page should say something about it: http://docs.jquery.com/CSS#css.28_properties_.29 Anyways, use textAlign and fontFamily. Same is true for any property with a hyphen in it. --Erik On 8/5/07, jayturley [EMAIL

[jQuery] Re: How to bind a function to all elements?

2007-08-01 Thread Erik Beeson
How about: $('*').hover(...); Or maybe a little more practical: $('body *').hover(...); So you don't get all of the elements in the head. --Erik On 8/1/07, barnezz [EMAIL PROTECTED] wrote: Hello I need to bind an hover function on every element of my page... but it doesn't work :-(

[jQuery] Re: tr[position() mod 3 = 0]

2007-07-30 Thread Erik Beeson
Untested: $('tr').filter(function(position) { return position % 3 == 0; }); --Erik On 7/30/07, Dmitrii 'Mamut' Dimandt [EMAIL PROTECTED] wrote: What would be the jQuery way of doing tr[position() mod 3 = 0] ? Thank you!

[jQuery] Re: Iteration through multiple class attribute values

2007-07-27 Thread Erik Beeson
each iterates over the elements of a given array. Since a string is an array of characters (try alert(bar[1]) if you don't believe it), each is iterating over each character. Maybe try splitting the classes on space characters? Maybe something like this: $.each(foo.className.split(' '), ...);

[jQuery] Re: Firebug shows Too Much Recursion errors after clicking OK in alert box

2007-07-25 Thread Erik Beeson
You don't need to wrap the parameter to not in $(...). Maybe try: $(a).not(#nav a).click(function() { alert('...'); return false; }); --Erik On 7/25/07, RwL [EMAIL PROTECTED] wrote: Not sure if this is my code's problem or Firefox's... I don't seem to be throwing any JS errors in MSIE.

[jQuery] Re: ANNOUNCEMENT: jQuery resetDefaultValue plugin

2007-07-25 Thread Erik Beeson
Then the filtering should be done on the selection end, not in the plugin. Of course you can make your plugin do whatever you want, but for general purpose use, there is an expectation that chainable functions won't modify the chain (unless their specifically designed to like filter, find, etc).

[jQuery] Re: Figuring Type of Selected Element

2007-07-24 Thread Erik Beeson
Maybe: $(this).is('table') Although, you might want to just use different selectors for the different elements: $(...).find('table').each(...); $(...).find('div').each(...); --Erik On 7/24/07, G[N]Urpreet Singh [EMAIL PROTECTED] wrote: Hi, I am running an each loop on a group of child

[jQuery] Re: jQuery jEditable

2007-07-20 Thread Erik Beeson
Your question is about PHP, not jQuery. You'd have better luck on a PHP forum. --Erik On 7/20/07, Aureole [EMAIL PROTECTED] wrote: I'm using the jEditable plugin which can be found here: http://www.appelsiini.net/~tuupola/258/jeditable-in-place-editor-plugin-for-jquery/save.php The

[jQuery] Re: Better way to select parent form?

2007-07-18 Thread Erik Beeson
$this = $(#myinput); $thisForm = $(form,$this.parent()) I didn't really read the OP, but I think that's the same as: $thisForm = $('#myinput').parent().find('form'); Or at that point, might as well do: $thisSubmit = $('#myinput').siblings('[EMAIL PROTECTED]submit]'); --Erik

[jQuery] Re: Better way to select parent form?

2007-07-18 Thread Erik Beeson
Maybe you want something like: $thisSubmit = $('#myinput').parents('form').find('[EMAIL PROTECTED]submit]'); --Erik On 7/18/07, jarrod [EMAIL PROTECTED] wrote: Erik Beeson wrote: $this = $(#myinput); $thisForm = $(form,$this.parent()) I didn't really read the OP, but I think that's

[jQuery] Re: Complex(ish) table formatting code not working in Firefox 2

2007-07-17 Thread Erik Beeson
I'm not sure what problem you're having. The pages appear to render identically in FF and Safari... What about it do you think isn't working right? In looking through the generated source in firebug, it appears that all of your classes are getting added to the correct elements... Actually,

[jQuery] Re: dev tip: combining JS script files

2007-07-16 Thread Erik Beeson
This part of the text seems contradictory with jQuery's habits. Why do we load jQuery.js and all its plugins in the head section? (answer: to have .ready()). But should we do it all the time and for all plugins? My understanding is we put script tags in the head so as to not clutter up the

[jQuery] Re: dev tip: combining JS script files

2007-07-16 Thread Erik Beeson
My understanding is we put script tags in the head so as to not clutter up the body DOM. I don't think it has anything to do with ready(), and I'm pretty sure ready() doesn't require script tags to be in the head... Yes, but if you put the scripts at the end of the body you don't need to

[jQuery] Re: How do you delay for a few seconds

2007-07-14 Thread Erik Beeson
Maybe (untested): $('#myDiv').show(); setTimeout(function() { $('#myDiv').hide(); }, 5000); Where 5000 is the duration to show it for, in milliseconds (i.e., 1000 = 1 second). Hope it helps. --Erik On 7/14/07, goofy166 [EMAIL PROTECTED] wrote: I have mastered many of the incredible

[jQuery] Re: Chaining of display effects.

2007-07-13 Thread Erik Beeson
I'm wondering if your description of what you want is a little off. You say you want to hide form1 if button1 is clicked and form1 is already visible. But your code looks more like you're trying to hide form2 if button1 is clicked... If you want the latter, I think it would be as easy as

[jQuery] Re: http://:/ issue?

2007-07-12 Thread Erik Beeson
When do you see such a thing happening? I'm using firebug to watch all network traffic and I don't see that request, nor do I see any javascript errors that would indicate something isn't right... --Erik On 7/11/07, Roger Ineichen [EMAIL PROTECTED] wrote: Hi all I have on my server and see

[jQuery] Re: Syntactic sugar for checking whether an element exists

2007-07-09 Thread Erik Beeson
Another idea is that if the seletor doesn't select any elements, return null (as does getElementById() in that case): ... but that may not be backward compatible. Of what use is an empty jQuery object? An empty jQuery object doesn't break chainability: $('#foo').hide(); Will hide the

[jQuery] Re: Syntactic sugar for checking whether an element exists

2007-07-09 Thread Erik Beeson
, or show an alert if the element doesn't exist. Equivalent to: var $foo = $('#foo'); if($foo.length 0) { $foo.show(); } else { alert(foo doesn't exist); } Just an idea. --Erik On 7/9/07, Erik Beeson [EMAIL PROTECTED] wrote: Another idea is that if the seletor doesn't select any elements

[jQuery] Re: Quick question about jQuery getElementsByName

2007-06-28 Thread Erik Beeson
From http://docs.jquery.com/DOM/Traversing/Selectors Get the input field's value with the name of 'bar': $([EMAIL PROTECTED]).val(); --Erik On 6/27/07, Yansky [EMAIL PROTECTED] wrote: How would I use the document.getElementsByName() selector method in jQuery?

[jQuery] Re: Interface drag/drop: Limiting number of items

2007-06-28 Thread Erik Beeson
I'm not a whiz at interface, but here's a rough stab at it to get you started with something. Totally untested, so good luck :) $('#firstList').Droppable({ ..., onDrop: function(drag) { if($(this).size() 3) { $(this).children(':last').prependTo('#secondList'); } } });

[jQuery] Re: jQuery solutions needed...

2007-06-27 Thread Erik Beeson
If you're looking for really fancy Desktop Application type controls, jQuery probably isn't the right library for you. jQuery is awesome at being a really small, blazing fast library that adds just the right amount of features to the javascript language that it actually makes javascript

[jQuery] Re: Draggables in jQuery

2007-06-27 Thread Erik Beeson
Good luck editing Brice's code :) On 6/27/07, weepy [EMAIL PROTECTED] wrote: lurvely - i can easily hack an end event into that and it makes it droppable ! On Jun 27, 7:27 am, Gilles (Webunity) [EMAIL PROTECTED] wrote: Drag yes, drop no ;) http://dev.iceburg.net/jquery/jqDnR/

[jQuery] Re: Transitions equivalent

2007-06-27 Thread Erik Beeson
Like this? http://gsgd.co.uk/sandbox/jquery.easing.php --Erik On 6/27/07, Allan Mullan [EMAIL PROTECTED] wrote: Hey guys (and gals) Are there any plugins for jQuery that work like the transition effects from Mootools (http://docs.mootools.net/Effects/Fx-Transitions.js) - Especially the

[jQuery] Re: jQuery solutions needed...

2007-06-27 Thread Erik Beeson
development team. Is interface not part of core development team? - GTG On 6/27/07, Erik Beeson [EMAIL PROTECTED] wrote: If you're looking for really fancy Desktop Application type controls, jQuery probably isn't the right library for you. jQuery is awesome at being a really small, blazing fast

[jQuery] Re: jQuery solutions needed...

2007-06-27 Thread Erik Beeson
to keep them apart so the community can choose what's appropriate for their project. As for hosting, Interface's code is actually hosted on the jQuery SVN. Rey... Erik Beeson wrote: While it's arguing a bit of a technicality, I maintain that Interface is not part of the core development of jQuery

[jQuery] Re: Drop event

2007-06-26 Thread Erik Beeson
That's just the position of the draggable (which you've called 'droppped'), right? Maybe: $(dropped).css('left') and $(dropped).css('top'). Or you could use a function on the onDrag event of the draggable that updates some local variables to save the last position: var x; var y;

[jQuery] Re: How to Rotate an Image 90 Degrees

2007-06-26 Thread Erik Beeson
JavaScript is with canvas[1] or SVG[2], both of which don't have enough browser support to Huh? Canvas works on IE6 (with excanvas), IE7, FF since 1.x, Safari and Opera. What other browsers are you looking for? --Erik

[jQuery] Re: FrameReady Help

2007-06-26 Thread Erik Beeson
You're calling a function called 'load'. Maybe you mean to call $.load(...)? The here alert probably isn't firing because you probably don't have a function called 'load', so execution is halting there. The FireBug extension for firefox would help you identify javascript errors like this.

[jQuery] Re: How to Rotate an Image 90 Degrees

2007-06-26 Thread Erik Beeson
Replicates canvass support in IE6. Anyone use it? Does it work well? Yes I do. Yes it does. No clipping, no patters, but all the basic stuff is there and works pretty well. You heard it here first: canvas will be the next big thing, like AJAX was. XHR was around for a long time before the

[jQuery] Re: How to Rotate an Image 90 Degrees

2007-06-26 Thread Erik Beeson
r u kidding... IE doesnt... excanvas simulates canvas behavior in IE. Which goes back to what I said about their not being enough browser support for the effort to be worthwhile (ON PUBLIC FACING WEB SITES). If you can convince your IE users to download and install excanvas, then more power

[jQuery] Re: Quick question...

2007-06-26 Thread Erik Beeson
The html function is synchronis, it should be done before it returns. What isn't working about it? Could you setup a sample page, or include a complete example of the code that you're using? --Erik On 6/26/07, Trav Johnston [EMAIL PROTECTED] wrote: Hi, I need to find the height of a div

[jQuery] Re: Is it possible to attach codes to body.onload via document.ready?

2007-06-23 Thread Erik Beeson
the window.onload event fires when all external dependencies (such as images) have loaded. You can bind events to it with: $(window).load(function() { alert('Everything is loaded!'); }); Is that what you're looking for? --Erik On 6/23/07, howa [EMAIL PROTECTED] wrote: Hello, is it

[jQuery] Re: Is it possible to attach codes to body.onload via document.ready?

2007-06-23 Thread Erik Beeson
Try this: html head script src=jquery.js/script script function test() { alert('test'); } $(document).ready(function() { }); // Assign event to window.onload $(window).load(test); /script /head body TEST123 /body /html --Erik On 6/23/07, howa [EMAIL PROTECTED] wrote: Thanks...but

[jQuery] Re: jEditable - sending additional param. values

2007-06-22 Thread Erik Beeson
By default, jEditable sends 2 parameters, the ID of the element being edited, and the new value. If you want to pass along additional data, you can add a parameter called submitdata and give it a hash (key/value object) of additional parameters. for example: $(...).editable(url, { ...,

[jQuery] Re: jEditable - sending additional param. values

2007-06-22 Thread Erik Beeson
I think you just want the default behavior... In the event that you still need further customization, you can also give submitdata a function that returns an object hash of additional parameters: $(...).editable(url, { ..., submitdata: function(oldValue, settings) { console.log(this); //

[jQuery] Re: how could I unbind .hover() ?

2007-06-22 Thread Erik Beeson
when using the hover helper method. The hover helper method assigns an anonymous method to both the mouseover and mouseout events. This anonymous function then decides if it should fire the given mouseover or mouseout functions provided to .hover(). -- Brandon Aaron On 6/22/07, Erik Beeson [EMAIL

[jQuery] Re: Hash to array

2007-06-22 Thread Erik Beeson
$.param(obj) is similar to what you're looking for. It uses as a separator instead of , but it's similar. If nothing else, you could look at the jQuery source for it. --Erik On 6/22/07, Alexandre Plennevaux [EMAIL PROTECTED] wrote: Warning this is a real noobie question. if you don't mind

[jQuery] Re: Easing rocks

2007-06-21 Thread Erik Beeson
I like backin/out. It feels like the virtual equivalent of physical toggle switches that work like that (often used as power switches). I disagree about having that stuff in the core though. Often I don't even need animations or ajax, but part of what I really like about jQuery is that it's

[jQuery] Re: jEdible in place editor plugin

2007-06-21 Thread Erik Beeson
The official site has quite a few examples: http://www.appelsiini.net/~tuupola/jquery/jeditable/ What problems are you having? Note that if your quantity variable is blank, the containing div won't have any height and you won't be able to trigger the editing. --Erik On 6/21/07, cfdvlpr [EMAIL

[jQuery] Re: NEWS: iPhone Browser Capabilites Released

2007-06-20 Thread Erik Beeson
I think the biggest reason to start adapting your webapp to the iPhone is so you can convince your boss that the company must buy you one to test with :) Here's a page that has a bit more detail: http://www.macrumors.com/2007/06/19/iphone-web-development-guidelines/ Whoops, I see they just

[jQuery] Re: problem with animate()...

2007-06-17 Thread Erik Beeson
Having no actual idea and just venturing a guess, I'd say maybe there's a compounding rounding error or something? Maybe try setting the correct value after the animation has completed (via a callback)? --Erik On 6/17/07, Byron [EMAIL PROTECTED] wrote: Hi all, this is my first post to this

[jQuery] Re: problem with animate()...

2007-06-17 Thread Erik Beeson
It doesn't seem to happen consistently... On 6/17/07, Erik Beeson [EMAIL PROTECTED] wrote: Having no actual idea and just venturing a guess, I'd say maybe there's a compounding rounding error or something? Maybe try setting the correct value after the animation has completed (via a callback

[jQuery] Re: Reading a querystring to determine an action - possible?

2007-06-16 Thread Erik Beeson
You can access the current URL from javascript via window.location Maybe try parsing window.location.href or window.location.search ? --Erik On 6/16/07, Bruce MacKay [EMAIL PROTECTED] wrote: Hi folks, I'm working on a site that, by default, has a RHS sidebar. I want to be able to

[jQuery] Re: how do i wait for the images to be fully downloaded?

2007-06-14 Thread Erik Beeson
There is a window.load event, and that's what you want to use: http://docs.jquery.com/Events#load.28_fn_.29 So you want: $(window).load(function() { // My stuff to do once all images are loaded... }); --Erik On 6/14/07, GianCarlo Mingati [EMAIL PROTECTED] wrote: Hi, the question may not

[jQuery] Re: Accessing elements in a Table

2007-06-14 Thread Erik Beeson
Maybe (untested): $('select.amount').bind('change', function() { var $parent = $(this).parent(); var $price = $parent.siblings('.price'); var $total = $parent.siblings('.total'); $total.html(parseInt($(this).val())*parseInt($price.html()); }); Or if you're really paranoid that your markup

[jQuery] Re: INSPIRE: eyeos.org

2007-06-13 Thread Erik Beeson
I watched the demo video and thought, Gee, that's slick, but it would be amazing if they could do it without flash. Then I logged in to the demo and found it isn't using flash. That's by far the richest javascript only app I've ever seen. I can't imagine the work that goes into building something

[jQuery] Re: [jQuery][de] German Support Forum? intrested?

2007-06-13 Thread Erik Beeson
And there's always: http://www.google.com/translate?u=http%3A%2F%2Fgroups.google.com%2Fgroup%2Fjquery-en%2Fmsg%2Fca4314bba5481fa0langpair=de%7Cenhl=enie=UTF8 --Erik On 6/13/07, Olaf Bosch [EMAIL PROTECTED] wrote: cfreak schrieb: I would like to make a german Support forum for jQuery,

<    1   2   3   4   >