Re: [jQuery] ajaxStart and ajaxStop

2006-08-13 Thread Michael Geary
$().ajaxStart( function ) and $().ajaxStop() are great to show/hide a global Ajax activity image/message. But sometimes it would be nice to temporarily inactivate this functions. E.g when you have a very short Ajax request, showing an image for a second or so is more annoying then really

Re: [jQuery] Accessing Input Attributes

2006-08-14 Thread Michael Geary
alert($(#btn_save).disabled); you may .get(0) to get the (first and only) element of $(#btn_save) : alert($(#btn_save).get(0).disabled); I'd have thought by using the ID selector there should only be one object returned anyway. $() always returns one object: a jQuery object. It

Re: [jQuery] Problems with download

2006-08-14 Thread Michael Geary
Now the problem: When I clicked the download link and tried to scoll right to view more of the page Firefox actually crashed --and I mean bad. It locked up my whole system. Don't shoot the messenger, but something is wrong with your system. Firefox shouldn't be capable of locking it up like

Re: [jQuery] Closures

2006-08-15 Thread Michael Geary
http://laurens.vd.oever.nl/weblog/items2005/closures/ Has this been found to be an adequate solution to this issue? (mainly for non jquery code) Yes, it solves the IE closure problem very nicely. My closure plugin for jQuery uses a modified version of this code. -Mike

Re: [jQuery] The format of xml response

2006-08-21 Thread Michael Geary
You are not sending down a Content-type: text/xml header, so the browser is interpreting your XML as plain text. To confirm this suspicion, change your alert to: alert( xml ); You want the alert to display something like [object XMLwhatever]. Instead, it will probably display the actual XML

Re: [jQuery] 3d Universe in jQuery

2006-08-25 Thread Michael Geary
Yesterday scientists agreed about the fact that Pluto shouldn't be called 'Pluto' anymore, but 'Dwarf' from now on. The name is choosen because it's the smallest (discovered) planet in the universe, and a so called 'dwarf'-planet.. Not true! Yes, Pluto is now classified as a dwarf planet

[jQuery] Quantum computing in jQuery: $().unload()

2006-08-27 Thread Michael Geary
The advanced event plugin creates three $() methods for each event: a binding method foo(), a one-shot binding method onefoo(), and an unbinding method unfoo(). Two of the events that this plugin wraps are the load and unload events. Therefore, $().unload() can be either the unbinding method for

Re: [jQuery] jQuery copy constructor

2006-08-29 Thread Michael Geary
From: Ferdinand Beyer What I would really like to see in the standard library is that jQuery objects can be passed to the $() function to obtain a copy: var $a = $('some.query'); var $b = $($a); $b.filter('some.criteria'); // Does not affect $a It looks like jQuery 1.0 does this.

Re: [jQuery] Central Hosting of Latest File

2006-08-29 Thread Michael Geary
Have you considered using goggle projects (http://code.google.com/hosting/) to host the central latest file and maybe related plugins? The reason I mention it is because we can all benefit from caching to load the file quickly. Also, I think the popularity of jQuery is going to grow

Re: [jQuery] Interface Library, Firefox on Mac

2006-09-03 Thread Michael Geary
interface is a reserved word. http://javascript.about.com/library/blreserved.htm I guessed somethink like this already... Stefan (Petre), is there any quick fix available / possible? :-) Thanks, Arash You could edit the code and change that word to see if it fixes it. The function in

Re: [jQuery] Bug with .css('z-index', '2')

2006-09-06 Thread Michael Geary
From: Dylan Verheul Actually, in DOM terms, zIndex is the only correct name. From: aedmonds Right... but for CSS properties I believe z-index is the only correct name for the zIndex property. Maybe I'm wrong but do know you set zIndex by using p { z-index: 2; } I guess I've

Re: [jQuery] Using JQuery in our site

2006-09-09 Thread Michael Geary
From: Albert Garcia I will thanks JQuery developers community specially John for this incredible library. We've been using it during the redesign of our software download portal's program page, wich is finally online in our german site: http://www.softonic.de . It has helped us

Re: [jQuery] Using JQuery in our site

2006-09-09 Thread Michael Geary
From: Michael Geary I could probably track it down but I haven't had any coffee yet... From: Klaus Hartl Someone bring Mike a coffee please! Ah, thanks, Klaus, John sent one over by FedEx Instant Delivery (and it was good coffee, not instant!). From: Albert Garcia Although, I've

Re: [jQuery] prototype $H()

2006-09-10 Thread Michael Geary
Does jquery have something like $H() ? I'm trying to convert a prototype based script var a = $H({ a1: [1, 2], a2: [3, 4], }); and a.each(function(n) { var v = $H(n).value; }); how would I do this in jQuery? What does it do? -Mike

Re: [jQuery] Preserving context within closure

2006-09-11 Thread Michael Geary
From: Jonas Galvez (via Patrick Hall) Is there any standardized way to preserve context when setting callbacks within an object's method? Here's how I see it is done now: function Editor() { // class Editor var self = this; $(document).ready(function() { self.doSomething(); }); }

Re: [jQuery] Form questions

2006-09-11 Thread Michael Geary
From: Yehuda Katz 1) Is it possible to easily get the current focused field? 2) Is it possible to programmatically get the cursor to blink in a text field? Hi Yehuda, I wonder if you saw my reply to your previous message on this topic: http://jquery.com/discuss/2006-September/011349/

Re: [jQuery] Form questions

2006-09-11 Thread Michael Geary
I did see your earlier comments. Unfortunately, any click event unblurs inputs. I've gotten around it by tracking the focus using a global variable and reassigning it using the DOM method focus(). Oh rats, what was I thinking. You're right, of course. Sounds like you have a good solution

Re: [jQuery] Sending array vs object

2006-09-14 Thread Michael Geary
From: Blair Mitchelmore If I'm not mistaken, anything can be used as a key if enclosed in quotes: f = {float:right} // no problem Rather than with implicit quotes: f = {float:left} // not so good They can then be accessed via the array accessor f['float']; // no problem

Re: [jQuery] Convert existing JS-code to jQuery

2006-09-15 Thread Michael Geary
From: Stefan Nagtegaal i want to port some pretty large JS-file to jQuery to take advantage of the easy way of writing and understanding it. Problem is, I never did much JS before.. Could you guys give me some workflow for what the best way would be to start and finish such a job? Any

Re: [jQuery] events on plugins

2006-09-16 Thread Michael Geary
$.fn.checkform = function() { $(this).bind(click, function(){alert(it works);} ); }; What am I doing wrong ? Ok I got it: $.fn.checkform = function() { return this.each(function(){ $(this).bind(click, function(){alert(it works);} ); });

Re: [jQuery] .toggle crashing IE

2006-09-22 Thread Michael Geary
From: digital spaghetti Now, in IE6 (at least in my copy) the bottom toggle bar works fine, so does the comments area - but the top bar keeps crashing IE6 - however it works fine in Firefox. At first I thought it might be because of the hidden nature, but my comment area is hidden by

Re: [jQuery] Google map plugin idea

2006-09-22 Thread Michael Geary
if (!window.GBrowserIsCompatible || !GBrowserIsCompatible()) return this; Is also possible? if ( !(window.GBrowserIsCompatible GBrowserIsCompatible()) ) If you don't say yes my headache gets worse! Don't get a headache, Klaus, that is fine and reads better too. After all, !( a b )

Re: [jQuery] $().load didn't works ini IE6

2006-09-25 Thread Michael Geary
I need help to make the following code works in IE : document.writeln(select name=\+name+\ id=\+name+\+((multiple!=null)? +multiple:)+); var tablename = some_table; $(#+name).load(table_query.php, {table: tablename}); document.writeln(\/select); Script

Re: [jQuery] $().load didn't works ini IE6

2006-09-25 Thread Michael Geary
From: Dan Atkinson Also, I'm unsure why you want to use document.writeln as I find jQuery's methods much more compact and neat. I don't know if it relates to this specific code, but there are things you can do with document.writeln that you can't do with DOM manipulation. Specifically, the

Re: [jQuery] Multiple Ready Blocks

2006-09-25 Thread Michael Geary
Is it permissable to have more than one $(document).ready(function() {}) per page? Yes, as many as you want. They will be called in the same order that the $(document).ready() calls were made. Note that there is a handy shortcut for $(document).ready(): $( function(){} ); -Mike

Re: [jQuery] No more IE6 background-flicker!!!

2006-09-26 Thread Michael Geary
Before y'all get too excited about this, keep in mind that it affects maybe one visitor out of ten thousand. The only people who run into this flicker problem are those who have gone into Internet Options / Temporary Internet Files / Settings and changed the check for newer versions setting to

Re: [jQuery] jQuery Projects

2006-09-26 Thread Michael Geary
He's been sick man. From: Rey Bango John! Where the heck you been man? We've missed your input here. :o) Rey,,, John Resig wrote: Woah - do you design for Quickbooks? That'd be hot :-) I really like the slidey menu - hidden, but useful, navigation. --John

Re: [jQuery] interesting syntax

2006-09-27 Thread Michael Geary
Here's a pattern that occurs frequently that I'm really curious about: new function() { // do stuff } Is the purpose of this just to provide local scope to the variables used? Yes, that is the one and only reason for it. Is there an equivalant syntax that may be more common?

Re: [jQuery] Use $.extend to clone object

2006-09-27 Thread Michael Geary
From: Klaus Hartl is it possible to use $.extend to clone an object? var template = { ... }; clone = $.extend({}, template); To answer my question, yes it works :-) Keep in mind that extend() does a shallow copy, not a deep copy. var one = { a:1, b:{ c:2 } }; var two =

Re: [jQuery] interesting syntax

2006-09-27 Thread Michael Geary
Yes, as others mentioned, ( function() { /*stuff*/ } )(); will do the trick too, and is slightly more efficient. is there somethign special about ( ... )(); ? I mean, how does this come from another example? There's nothing special about it. Any time you have a reference to a function,

Re: [jQuery] Form plugin's serialize(): performance issues

2006-09-27 Thread Michael Geary
From: Mike Alsup Seems to be faster rewriting it with a for loop instead of using each. Matt, can you confirm? Here's a skeleton of another way to approach the problem. Instead of enumerating every element inside the form, it looks at each nodeName as it goes and decides what to do from

Re: [jQuery] Form plugin's serialize(): performance issues

2006-09-28 Thread Michael Geary
From: Mike Alsup Mike Geary, I haven't yet implemented your outline. I like it stylistically, but I not expecting performance improvements. Would you agree or would you expect it to be faster than Renato's impl? I think it depends on the nature of the form. For a form with a SELECT

Re: [jQuery] iUtil use it

2006-09-30 Thread Michael Geary
Even if your not using the interface plugin you need down load the iUtil plugin and start using it. I even think that iUtil should go core. A link would be terribly useful when promoting something this hard. :) I don't want to hot link the file, but you can find it here

Re: [jQuery] Help with the SVN Build Process

2006-10-01 Thread Michael Geary
From: Joel Birch I am obviously missing something here - can we not just have some sort of friendly web interface that retrieves the latest version of jQuery and whatever else this Ant build gives you? This seems like a high barrier to entry considering the potential demographic that

Re: [jQuery] Help with the SVN Build Process

2006-10-01 Thread Michael Geary
Sam was correct that I wanted the latest SVN version. I also wanted to see if I was missing out on any other information that the build process provided. @Michael: I got the idea that it would be a good thing to have access to this from what John Resig mentioned when 1.0 was released.

Re: [jQuery] Fast form serializer function for review

2006-10-03 Thread Michael Geary
Nice. You could simplify this: var f = ['INPUT', 'TEXTAREA', 'SELECT', 'BUTTON']; $(f.join(','), this).each(function() { to: var f = 'INPUT,TEXTAREA,SELECT,BUTTON'; $(f, this).each(function() { BTW, what do you mean when you say it isn't a plugin? Looks like one to me. :-)

Re: [jQuery] Single Value Attributes

2006-10-03 Thread Michael Geary
$.fn.checked = function(b) { if ( b || b == undefined ) this.attr( checked, checked ); else this.removeAttr( checked ); }; I strongly suggest you to compare if a variable is equal to undefined using the typeof unary operator, because if you, someday, dicide to

Re: [jQuery] .each backwards ?

2006-10-07 Thread Michael Geary
From: Dossy Shiobara I'm surprised there's no .reverse(). i.e.: $(collection).reverse().each(...) Great idea! How about the world's smallest plugin: jQuery.fn.reverse = [].reverse; Try it out at http://jquery.com/ by entering these lines into the FireBug console:

Re: [jQuery] .each backwards ?

2006-10-07 Thread Michael Geary
jQuery.fn.reverse = function() { this.pushStack(this.get().reverse()); return this; } Nice. That is a better approach then just doing jQuery.fn.reverse = [].reverse. I'm curious, what is the advantage of one approach over the other? -Mike

Re: [jQuery] jquery update causes js error

2006-10-08 Thread Michael Geary
From: Stephen Woodbridge [EMAIL PROTECTED] http://imaptools.com:8081/maps/demo2.html From: Brent Pedersen i'd guess the offending line is in mscross: Object.prototype.objRef = null; Good catch. It's strictly verboten to add to Object.prototype. That will break all kinds of things, not

Re: [jQuery] jquery update causes js error

2006-10-09 Thread Michael Geary
Thank you very much! That was it. [Object.prototype.objRef = null;] Any idea why that would have been done in the first place? Probably because the person who wrote that code didn't know any better! I ran into another issue that all my for loops in code I added to mscross were

Re: [jQuery] IE7 May be Pushed out Tomorrow

2006-10-09 Thread Michael Geary
Does anybody know if it is possible to run both IE 6.x and IE7 both on thesame system? An absolute must if you are a web developer... Use VMware and you can run every version of IE, and Firefox, and any other Windows browser you want to test. http://www.vmware.com/ -Mike

Re: [jQuery] Performance question

2006-10-09 Thread Michael Geary
From: Brendan O'Brien I have a somewhat related observation. I have discovered that when selecting by ID, the context parameter does not matter. In other words, these two statements are functionally equivalent: $(#myId); and $(#myId, myContext); It's as if when the id selector

Re: [jQuery] Appending option to select

2006-10-11 Thread Michael Geary
From: patrickk I´m using the plugin for DOM creation to accomplish that. see http://mg.to/2006/02/27/easy-dom-creation-for-jquery-and-prototype From: Rey Bango I tried using this plugin but it didn't seem to work with v1.0.1. Which version of JQuery are you using? Rey, which of the

Re: [jQuery] Breakable Each

2006-10-12 Thread Michael Geary
I really prefer doing a 'return false' instead of throwing exceptions. It just feels like an incredibly messy way to handle things - plus it prevents you from writing good one-liners, which makes me sad. Plus the change is trivial, too: each: function( obj, fn, args ) {

Re: [jQuery] Set height problem

2006-10-12 Thread Michael Geary
Sanyi, "this" is not the same when you're inside a nested function. Add this line of code at the beginning of showFlash: var self = this; And then change "this" to "self", and you'll be in business. (You can use any variable name instead of "self"; that's just a common choice.) Also,

Re: [jQuery] attach a click event to everything but one TRelement...??

2006-10-14 Thread Michael Geary
Don't use underscores in element IDs. It's not a valid character, and some browsers (like, MSIE) will not do what you want if you use it. http://devedge-temp.mozilla.org/viewsource/2001/css-underscores/ Use hyphens, if you insist on using a visual separator. That's not quite right.

Re: [jQuery] Plugin Authoring

2006-10-15 Thread Michael Geary
Authoring guidelines say Always use jQuery instead of $ inside your plugin code - that allows users to change the alias for jQuery in a single place. Does this mean only the first line jQuery.fn... or should also extend be jQuery.extend()? That means everywhere inside. So if you did

Re: [jQuery] jquery snapshots

2006-10-17 Thread Michael Geary
Use the SVN version if you want to do that sort of thing. http://jquery.com/src/ - Shows you the SVN access address. AFAIK this has to be built first before it is usable. I am looking for readily built snapshot. No, it doesn't have to be built. The svn code is usable right out of the

Re: [jQuery] Using javascript variable for HASH

2006-10-17 Thread Michael Geary
I imagine that it must be some way to use javascript variable for HASH... Is it possible? I show you the code that I'm using (and it show me an error in FireBug (Firefox):reference to undefined property imts): function LoadAjax(t,d,id){ var itms itms='{url: GetValues'+t+'.asp, type:

Re: [jQuery] ThickBox in Filemanager

2006-10-17 Thread Michael Geary
Well, as I've already said, you won't be able to show the PDF in a thickbox, because the OS/browser will catch the link and try to open it using the default action set in the browser or OS, and there's nothing that you can do to override it. If no default action is set, then you -might-

Re: [jQuery] Bug in Firefox with e.target?

2006-10-19 Thread Michael Geary
From: Klaus Hartl I wanted to add the normalization for e.target as discussed earlier. But I came across a strange bug in Firefox. Have a look at the following page: http://stilbuero.de/demo/jquery/etarget.html If you click on the link the target of the click event (attached to p)

Re: [jQuery] Returning a query?

2006-10-20 Thread Michael Geary
From Rey Bango: and then use the JSON plugin (http://mg.to/2006/01/25/json-for-jquery) to work with the data. From: Aaron Heimlich Or you could (as of 1.0.2, possibly a bit earlier) do $.getJSON(file.php,function(r) { alert(r); }); See the API docs http://jquery.com/api/

Re: [jQuery] method/plugin for getting query string vars?

2006-10-21 Thread Michael Geary
In Jörn's version of the code, you wouldn't call $.query() at all. Instead, $.query would be the resulting object that you would then use directly. Note that jQuery and $ are references to the same object, so jQuery.query and $.query are the same thing. I'm not sure I like this idea since it

Re: [jQuery] Off topic : javascript css

2006-10-22 Thread Michael Geary
$(function(){ $('head').append('link rel=stylesheet href=jquery.css type=text/css'); }); That's pretty dangerous. The CSS file will load asynchronously, and you won't know when it's done. In the meantime, any content in the page may render unstyled. You are likely to get a flash of

Re: [jQuery] Is there a way to dynamically load jquery plugins

2006-10-22 Thread Michael Geary
I would like to be able to load my jquery plugins dynamically as this would reduce the number of scripts in my document head. You can easily load any .js file dynamically, for example with code like this: function addScript( url ) { var script = document.createElement( 'script' );

Re: [jQuery] Expressions: Search for children within context

2006-10-22 Thread Michael Geary
how do I search for a children within a context? In other words, how to translate this: $(context).children(dt)... into something like this: $(/dt, context) The latter one does unfortuanetely not work... I'm confused - could you give an example with some HTML code and show exactly

Re: [jQuery] Is there a way to dynamically load jquery plugins

2006-10-23 Thread Michael Geary
From: Klaus Hartl Just wanted to note, that dynamic script elements are not supported in Safari 2.0. Support for that was added in Safari 2.01. Hmm... It works in older versions of Safari. I just tested it in 1.2. Are you saying the support was removed (or broken) in 2.0 and put back in

Re: [jQuery] jQuery and OOP

2006-10-24 Thread Michael Geary
Do you really need an object at all? This (pun intended) would do the same thing as all the code you listed: $(function() { var $btn = $('#btnCounter'), nr = 0; $btn.click( function() { $btn.attr( 'value', nr++ ); }); }); -Mike From: Kolman Nándor I am new

Re: [jQuery] triggering an event

2006-10-24 Thread Michael Geary
I was wondering having done: $(.foo).click(function (e) {alert (foo);}); Can I force the click event to fire manually, or do I resort to var x = function (e) {alert (foo);} $(#foo).click(x); ele = $(#foo).get(0) x.call( ele, {target:ele}); You can use either of these (they do the

Re: [jQuery] performance optimizations?

2006-10-26 Thread Michael Geary
1) Where can I find a searchable archive of this mailing list, because I'd hate to ask questions that have already been answered. Here are a couple: http://www.google.com/search?q=site:jquery.com+optimize+OR+optimization http://www.nabble.com/JQuery-f15494.html 2) I'm getting about a 1.5

Re: [jQuery] moddify the title tag

2006-10-30 Thread Michael Geary
humpf, I don't understand why I can't modify the title tag with jquery... I want to input some data after its loaded. For example, $(title).append(test); How come this does not work? You can't change the title tag's innerHTML once the tag has been encountered in the HTML code. This

Re: [jQuery] moddify the title tag

2006-10-30 Thread Michael Geary
You can't change the title tag's innerHTML once the tag has been encountered in the HTML code. This isn't a jQuery limitation; it's a browser limitation. I don't know if it is true for every browser, but it is for the ones I tested when I implemented dynamic titles a while ago.

Re: [jQuery] return this.each

2006-11-04 Thread Michael Geary
Simon, you've run into one of the more confusing things about jQuery. I think it's safe to say that jQuery code would be easier to understand if it used explicit function arguments everywhere instead of this. (There are other advantages of using this, but it is definitely a mixed blessing.) Every

Re: [jQuery] [Fwd: jquery bug 164] (explanation)

2006-11-04 Thread Michael Geary
To answer my own thought, I remembered it's a problem with the way many external COM controls work because they're not native Javascript objects. This post explains the situation a bit: http://blogs.msdn.com/ericlippert/archive/2004/09/20/231852.aspx Although IE cooperates with

Re: [jQuery] Plugin Release: Tooltip

2006-11-06 Thread Michael Geary
From: Jörn Zaefferer I actually managed to release my first official and documented jQuery plugin, a Tooltip implementation. It doesn't use AJAX, nor extra markup, only title and href attributes and some styles. You can customize the delay after which it should be displayed, default is

Re: [jQuery] Plugin Release: Tooltip

2006-11-06 Thread Michael Geary
http://bassistance.de/index.php/jquery-plugins/jquery-plugin-tooltip/ A suggestion - perhaps you should use 'jQuery' instead of '$' as isn't that the convention for plugin authoring? The code does use jQuery instead of $. Jörn used the trick I suggested a while back to get the best of both

Re: [jQuery] Plugin Release: Tooltip

2006-11-06 Thread Michael Geary
From: Paul McLanahan The only suggestion I have deals with displaying the tips close to the right side of the screen. You do an excellent job of handling the width of the tip when it is close to the right edge of the window, but if a word is too long inside of the tip it will push

Re: [jQuery] return this.each

2006-11-06 Thread Michael Geary
From: Simon Corless Thanks for the help Mike, it's starting to come together. I've been testing it just now. If I do use return this.each() then how do I reference the jQuery methods? without this.hover() etc? Obviously as this is no longer what I am expecting this.hover (as you say)

Re: [jQuery] this.name

2006-11-06 Thread Michael Geary
why doesn't this work: $('#text-field').val(this.name); What is this? You haven't given it a value. So it depends on the context of this code. If the code is not in an object method, then this is the window object. when this does: $('#text-field).click( function() { alert(this.name); }

Re: [jQuery] Plugin Release: Tooltip

2006-11-10 Thread Michael Geary
From: Michael Geary (function($) { // plugin code here })(jQuery); From: Sam Collett I've seen that used before, but can it have memory leak or other issues? Sorry about the very slow reply, Sam. That's a good point. The use of the closure could result in memory leaks

Re: [jQuery] Element tagName

2006-11-10 Thread Michael Geary
From: Laurent Yaish I couldn't find a way using jQuery to get the tagName of an element. Let's say I have this: divspantest/span/div $('span').parent().tag() would return 'div' From: Brandon Aaron You could do two things ... write yourself a plugin that would look something

Re: [jQuery] Since updating to 1.0.3 converting to getJSON

2006-11-11 Thread Michael Geary
And to make it valid JSON, you have to quote all keys anyway (using double quotes): { asJSON: 1, class: jlink, id: htmlDoc } http://json.org/ Naw, that wouldn't be valid JSON. JSON doesn't allow named references like htmlDoc. But this object doesn't need to be JSON anyway. It's just an

Re: [jQuery] OO programming is confusing to old functional programmers

2006-11-11 Thread Michael Geary
I don't think this approach will work quite the way you'd like. In your example: // I access my plugin via: $(#myMap).Map({ options hash }); // later I can access a public function on this object like: $(#myMap).Map.recenter(x, y, dxy); Those two $(#myMap) calls are going to result in

Re: [jQuery] Element tagName

2006-11-12 Thread Michael Geary
From: Truppe Steven my view of the things is a big different. I think jquery should stay as small as possible so adding functions for basic dom attributes is a bit overhead i think .. I agree. How do you decide which of the many DOM attributes to turn into jQuery methods? All of them?

Re: [jQuery] Elements aren't expanding when appending new children

2006-11-12 Thread Michael Geary
When you have a problem like this, your first thought should be to look at the generated HTML using Microsoft's DevToolBar in IE or either FireBug or View Source Chart for Firefox. I moved Testnode up and then moved it to the right, then used FireBug's Inspect tool to reveal the generated HTML.

Re: [jQuery] Elements aren't expanding when appending new children

2006-11-12 Thread Michael Geary
I moved Testnode up and then moved it to the right, then used FireBug's Inspect tool to reveal the generated HTML. This is what I saw: Actually I left out part of it by mistake. Here's the entire UL: ul id=nodes class=sortable li id=node5 class=sortableitem/li li

Re: [jQuery] Elements aren't expanding when appending new children

2006-11-12 Thread Michael Geary
One more comment... As you probably figured out from looking at the generated source, the culprit is likely to be the animation code, which sets those unwanted attributes when it animates an item. So one good test would be to remove all animation and see if it generates better code. It will also

Re: [jQuery] How do I add a js array of jquery objects to a jqueryobject?

2006-11-12 Thread Michael Geary
From: Andrea Ercolino I have got an array of 50 urls templates, and want to make a proper url out of each one, adding also a special click, and then append all these urls to a div in a specific position. All this should be done many times in a page, many could be 50, just to say

Re: [jQuery] How do I add a js array of jquery objects toajqueryobject?

2006-11-13 Thread Michael Geary
From: Michael Geary Yeah, all that DOM creation will take a while - especially if you use a convenience plugin like mine. I get much better performance across browsers with [].join('') and innerHTML. From: Dave Methvin There don't seem to be that many situations where DOM

Re: [jQuery] Why won't this work?

2006-11-13 Thread Michael Geary
So...the lesson is...the jquery.js file always has to be included for the jQuery code to work and it has to be referenced first...correct? It doesn't have to be *first*, but it does have to be before any code that uses jQuery. Think about it this way... Would this code work: alert( x );

Re: [jQuery] Object vs. Array looping

2006-11-14 Thread Michael Geary
In the .css method an array is created by: d = [Top,Bottom,Right,Left]; Then it is looped through using object looping: for ( var i in d ) { This probably isn't a problem for most people, but we have added functions to the Array prototype, so whenever the .css method is used it

Re: [jQuery] parsing JSON with $.each

2006-11-15 Thread Michael Geary
From: Kevin Old I'm parsing some json successfully below, but I'd like to be able access the contents of the json object like this.[id] or this.[name]. function processData(json) { $.each(json, function(i) { $(#names).append(ID: + this[0] +

Re: [jQuery] jQuery 1.1 by the end of Nov

2006-11-16 Thread Michael Geary
But, I would be sad to see .click, .hover, and .toggle go away, if they are among the helper functions you plan to put into a an external plugin. They just make so much more sense than bind to people new to programming/javascript/jQuery. I am not a fan of bind either, I'm sure it was

Re: [jQuery] Off topic: which programming language for webdevelopment

2006-11-22 Thread Michael Geary
Our company is looking for a way for 'quick' web-development. Small webapps consisting of a few webpages with some minimal database interaction. We currently develop everything in Java (including webapps), but I find the whole cycle of developing, compiling (java class files, EJBs

Re: [jQuery] getScript error

2006-11-23 Thread Michael Geary
Why not use document.createElement(script) !? Because we want jQuery to wait until the script is loaded and evaluated, so it's possible to do something upon completion, like continuing the normal flow of the program. This is necessary for example for writing a require like the one in

Re: [jQuery] closure and name conflict

2006-11-24 Thread Michael Geary
I really have no idea what is the correct name(I'm not a javascript guru), handle is a function in function(or jQuery?) scope? You know , i just copy your code structure. xD Demo page: http://61.191.26.228/jQuery/plugins/modal/test.html Your functions named plugin, modal_handle,

Re: [jQuery] closure and name conflict

2006-11-24 Thread Michael Geary
From: Michael Geary Also, that comma after the } shouldn't be there. It looks like you picked up the use of the comma from object literals... From: Jörn Zaefferer Actually there is a single var at the top, therefore the problem must be somewhere else... My fault, I should remove

Re: [jQuery] [OT] Firefox 2.0 Annoying Errors

2006-11-25 Thread Michael Geary
This has nothing to do with jQuery, but I'm hoping that some of you might have seen this and figured out how to make it go away. I have googled for it, but nothing helpful showed up. not jquery. I get a bunch of errors each time I start up ff 2... they don't recur. do yours? Did you

Re: [jQuery] [OT] Firefox 2.0 Annoying Errors

2006-11-25 Thread Michael Geary
Thanks Mike and Jake. I will try the uninstall and reinstall. Sounds like that might help. I had thought of doing just that, but it seemed a little heavy handed but hey, if it works that would be great. On the contrary, the uninstall and reinstall is about the least heavy-handed thing you

Re: [jQuery] Trouble with $(expr, context) and iframe documents

2006-12-11 Thread Michael Geary
From: Adam Skinner I'm trying to reference an element from within an iframe. The following normal javascript code works: var iframeDoc = window.frames[iframeName].document; var data = iframeDoc.getElementById(iframeElement); I'm trying to jqueryize the data variable as

Re: [jQuery] passing functions

2006-12-11 Thread Michael Geary
I had to do something similar today, and I did something like function myfunction(f){ $(element).click(function(){eval(f+(););}); } that was off the cuff, but that should work. That would be the ticket if f is a string containing the name of a function. But why not just pass a

Re: [jQuery] Dynamically added click registration always returns the last value added

2006-12-13 Thread Michael Geary
You're using the variable j to hold a reference to each element of the jobs array as you go through the loop. After the loop finishes, j is a reference to the last element of that array. Later, when the click function gets called, j still refers to that last element - regardless of which element

Re: [jQuery] Remove from JSON

2006-12-14 Thread Michael Geary
I suppose this touches on off topic, but ... is it possible to remove an entry completely from a JSON hash? say I have { firstString: 'first', secondString: 'second' } and evaluate this into a json object, and I want to remove firstString, could I do something like

Re: [jQuery] Remove from JSON

2006-12-15 Thread Michael Geary
I suppose this touches on off topic, but ... is it possible to remove an entry completely from a JSON hash? say I have { firstString: 'first', secondString: 'second' } and evaluate this into a json object, and I want to remove firstString, could I do something like

Re: [jQuery] (no subject)

2006-12-19 Thread Michael Geary
Try this (untested): $(function() { $('.y').html( (new Date).getFullYear() ); }); -Mike p.s. Could we avoid profanity on the mailing list? Thanks. _ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kristaps Ancans Sent: Tuesday, December 19, 2006 12:44 AM To:

Re: [jQuery] msie closures syntax

2006-12-27 Thread Michael Geary
Not only not related to jQuery, but not related to closures either. :-) The problem is that setTimeout doesn't accept the additional arguments you are passing it. Is there any reason you can't do this: setTimeout( function() { doStuff( stuff, 1, 2 ); }, 100 ); That would work in any browser.

Re: [jQuery] msie closures syntax

2006-12-27 Thread Michael Geary
this doesn't work like a local variable. Inside a nested function, this is not the same as in the outer function. That's what is messing things up. If I understand your code, you can write it more simply like this: (function($) { $.fn.Tooltip = function(settings) { var $all = this;

Re: [jQuery] dynamic plugin loading

2006-12-28 Thread Michael Geary
If you're just trying to load a stylesheet dynamically, all you need to do is this: function addSheet( url, doc ) { doc = doc || document; var link = doc.createElement( 'link' ); link.rel = 'stylesheet'; link.type = 'text/css'; link.href = url;

Re: [jQuery] dynamic plugin loading

2006-12-28 Thread Michael Geary
From: Michael Geary If you're just trying to load a stylesheet dynamically, all you need to do is this... Just to be clear, I wasn't disparaging jsPax! It just depends on whether you need a full-featured package system or a simple loading function. -Mike

  1   2   >