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 hid

Re: [jQuery] Google map plugin idea

2006-09-22 Thread Michael Geary
> > just a little thing: I'd check additionally for existence of > > GBrowserIsCompatible just in case the google maps script > > is not loaded for whatever reason: > > > > if (GBrowserIsCompatible && !GBrowserIsCompatible()) ... > I changed the check to > > // If we aren't supported, we're don

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, !(

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(""); > var tablename = "some_table"; > $("#"+name).load("table_query.php", {table: tablename}); > document.writeln("<\/select>"); > > Script table_query.php return elements. This code

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, t

Re: [jQuery] Cool technique

2006-09-25 Thread Michael Geary
> From: Yehuda Katz > > In my editInPlace script, I do: > > $(editable).animate({opacity: .5}, "normal", function() {$(editable).animate({opacity: 1}, "normal")}); > > which results in a slow emphasis. I think it works better than > the yellow-fade for emphasizing success of an update. > > What d

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 > mor

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 } };

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 funct

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

[jQuery] Hpricot (RE: Spread jQuery Request)

2006-09-28 Thread Michael Geary
> > Yes. I see now. Unfortunately, as Klaus said, jQuery no longer has > > this edge as other developers have cottoned on to this. > > Why "unfortunately"? A great concept was invented here, and > that's *very* fortunate. Thank you John, be proud :) Speaking of sincere flattery, has anyone seen

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 c

Re: [jQuery] Hpricot (RE: Spread jQuery Request)

2006-09-28 Thread Michael Geary
> > From: Michael Geary> > Speaking of sincere flattery, has anyone seen Hpricot? > > It's an HTML parser and munger for Ruby that uses > > jQuery-style expressions:> >> > http://code.whytheluckystiff.net/hpricot/   > From: Yehuda Katz> It doe

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 h

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 demographi

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 rele

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. :-) -Mi

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,

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: jQuery.fn.

Re: [jQuery] .each backwards ?

2006-10-07 Thread Michael Geary
> > From: Michael Geary > > > > Armed with this knowledge, one might be tempted to load > > all the Array methods in one fell swoop: > > > >jQuery.fn.prototype = Array.prototype; > > > > But that does not work, presumably because jQuery is >

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] search for id with '/' character

2006-10-07 Thread Michael Geary
> From: Su > > I'm curious: Why is everybody trying to "fix" the selector > problem, rather than pointing out the ID is invalid in the > first place? > > Dexter: Get rid of the slash altogether. Problem solved. > > You might be able to work around this with the various > suggestions others ha

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 thi

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 > > mscros

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 t

Re: [jQuery] Appending to

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

Re: [jQuery] Breakable Each

2006-10-11 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.)   Al

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 rig

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

Re: [jQuery] jQuery API discussion

2006-10-15 Thread Michael Geary
> > $().unload() - Removes load event handlers AND triggers unload event > > It actually doesn't do both, it just the last one that was > created (which, I think, is unload). Well of course it's unload. So is the first one - that's the problem! :-) Here's the actual code from event.js in the or

Re: [jQuery] Dynamic call

2006-10-16 Thread Michael Geary
> > $("#div").call() > > > > tries to call the "call" method on $, but since there is no "call" > > method (that I know of), it's not working. > > Actually, there is: > http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Ob jects:Function:call > > Using call or apply is ano

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

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+'.

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 -migh

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 > (attach

Re: [jQuery] jQuery Kinda Plugin: every

2006-10-20 Thread Michael Geary
> jQuery.fn.extend({ > every: function(interval,id,fn) { > return this.each(function() { > var self = this; > interval = jQuery.speed(interval); > if (fn == undefined) { > fn = id; > id = interval; > } >

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

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 means

Re: [jQuery] Off topic : javascript css

2006-10-22 Thread Michael Geary
> $(function(){ >$('head').append(''); > }); 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 unstyled content which is then reformatted when your C

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 sho

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 i

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 the

Re: [jQuery] I need help with the jQuery .click event

2006-10-25 Thread Michael Geary
I see Klaus posted a very clean solution, but just to help you understand what went wrong...   Pretend you are the _javascript_ interpreter, executing the code inside your click handler function after a click. You encounter the variable name "i" and need to find its value. Since "i" isn't def

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

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

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 > > w

Re: [jQuery] Plugin method question

2006-10-30 Thread Michael Geary
> The main reason I'm trying to avoid non-spec attributes is > for code longevity. Kurt suggested the class attribute. Any reason not to use it? It seems intended for this purpose: http://www.w3.org/TR/html4/struct/global.html#h-7.5.2 The class attribute has several roles in HTML: * As

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.) Ev

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, de

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 bo

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 pu

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 s

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.n

Re: [jQuery] return this.each

2006-11-10 Thread Michael Geary
Sorry about the slow reply, guys. Been a busy week! > From: Rexbard > > Mike, I already knew the mechanics of this, but I got caught > up in your description and had to read your entire post. > > Beautifully written, Mike. This has to be the clearest > description of the jQuery vs. DOM variabl

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

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: > > > > test > > $('span').parent().tag() would return 'div' > From: Brandon Aaron > > You could do two things ... write yourself a plugin that > would look someth

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.

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({ }); > > // 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 differ

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:

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 sa

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 &g

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 >

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("I

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

Re: [jQuery] Next generation WYSIWYG editor... maybe? am Imissing something?

2006-11-16 Thread Michael Geary
> I'm no expert for lincenses. But I remember that jQuery had > to be dual-licensed to allows the Drupal guys to integrate > jQuery into their core. Dunno why that was necessary or what > the idea is behind it. Only GPL code is allowed in the Drupal repository. Don't ask why! It just is. (There

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, EJB

Re: [jQuery] OT: fQuery

2006-11-23 Thread Michael Geary
> From: Steven Wittens > ... > Implementing a jQuery like query system has opened up a whole > new way of dealing with forms in Drupal. It's a really cool > technique. The best part is that it's relatively easy to > adapt the code to custom structures, as the parsing is > separate from the oper

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

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, mod

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

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? D

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 y

Re: [jQuery] Thickbox + ads + FF = broken..

2006-11-26 Thread Michael Geary
Try the svn version of jQuery. I had the same problem with 1.0.3 and the svn version fixed it. Let me know if that doesn't do it - next thing to check is the onload handler. > I'm having trouble with thickbox on pages that also have banner ads.. > I've made two examples: > > http://dev.twokings

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" var

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 ele

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 > json

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 so

Re: [jQuery] Remove from JSON

2006-12-17 Thread Michael Geary
Goodness, I didn't mean for the answer to shame or humble you! :-) There was nothing wrong with the question, just wanted to show a way to track down the answer. -Mike > Slightly ashamed. > Very good answer, I'm humbled. Thank you. > > Well, JSON is just a notation. Once you evaluate it, it's

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: discu

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; d

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 lo

Re: [jQuery] Having an issue accessing a node.

2006-12-29 Thread Michael Geary
> $('#blog[headline]').val('newvalue'); > > value="" /> > > It seems i cant access the node for [] in the name breaks the > ability to access it unless i am doing something wrong? [] are not valid characters in an id attribute: http://www.w3.org/TR/html4/types.html#type-name Browsers and jQu

Re: [jQuery] Having an issue accessing a node.

2006-12-31 Thread Michael Geary
> ...since the spec requires name and ID to be > identical, it's technically illegal to have a name with "[" > and an ID as well (since IDs cannot contain "["). Um, where does it say the name and id have to be the same? -Mike ___ jQuery mailing lis

Re: [jQuery] Click and Double Click

2006-08-08 Thread Michael Geary
> Click always happens before double-click. If you don't want > it that way, you'll need to setTimeout in click to see if a > double-click arrives, then cancel the timer if it does. That > has the undesirable side effect of delaying the click effect > until you are sure that no double-click hap

Re: [jQuery] - help with scroll function

2006-08-08 Thread Michael Geary
> var toggleContent = { > cel : null, > doIt : function (el) > { > if (this.cel) { > $('#' + this.cel).slideUp('slow'); > } > if (el != this.cel) { > this.cel = el; > $('#' + this.cel).slideDown('slow', function(cel){ > alert(this.cel); $('#h_' + this.cel).Scro

  1   2   >