Re: [jQuery] break in $.each

2007-01-04 Thread Michael Geary
Andreas, if I remember correctly, the following should work: $.each(object, function() { return false; }); That isn't supported. The necessary code was removed due to unsolved problems. Actually the stuff that Michael just posted would help a lot to solve it, though I'm not

Re: [jQuery] Another simple question...

2007-01-04 Thread Michael Geary
this.id = 'NewValue'; alert( this.id ); I've got another simple question. Is this not how you set an element's attribute? [from inside an .each()] ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/

Re: [jQuery] setting an attribute... I *thought* this was how to doit...

2007-01-05 Thread Michael Geary
$(function(){ $(div.OrderEntryListRow).not(.Selected).each(function(i){ alert(before: + $(this).attr(id)); $(this).attr(id, Row_ + (i+1)); $(this).html($(this).html() + ': ' + (i+1)); alert(after: + $(this).attr(id)); }); }); Any time you see

Re: [jQuery] setting an attribute... I *thought* this was how to doit...

2007-01-05 Thread Michael Geary
Chris, it's like this... ;-) $() returns a jQuery object, which is an array of DOM elements with jQuery methods that apply either to the entire array or to the first element in the array, depending on the method. One of those methods is .each(), which loops through the DOM element array and

Re: [jQuery] Passing values to a custom function

2007-01-08 Thread Michael Geary
Do you want getPost to be called during the execution of initialiseForm, or later in response to the 'submit' event? For the latter, use this (added code in red): function initialiseForm(formId) { $(formId).bind('submit', function() { getPost(formId) } ); } -Mike _ From: [EMAIL

Re: [jQuery] 1 Function, Multiple Events?

2007-01-11 Thread Michael Geary
if have some thing like this that is called by document.ready(): function init_top_level() { $(.top_folder).click(function(i) { // Do a ton of stuff here }); } I not only want to assign the click event to my .top_folder elements, but assign dblclick as well. I

Re: [jQuery] List of jQuery-Powered Sites

2007-01-11 Thread Michael Geary
Forgot to add us to the list... Zvents: http://www.zvents.com/ This is a Rails site and we completely replaced prototype.js with jQuery and our own code. We're using thickbox, a homegrown autocompleter, my DOM plugin, and lots of custom code. This also puts jQuery on our partner sites: The

Re: [jQuery] 1 Function, Multiple Events?

2007-01-11 Thread Michael Geary
Thanks for the assistance. Yes, I was basically trying to assign a click and dblclick to the same function (to prevent users from double-clicking and firing the func twice). Hmm... If you assigned both click and dblclick to the same function, then the function *would* be called twice on each

Re: [jQuery] How to get element when it's ID contains bank space.

2007-01-11 Thread Michael Geary
Scripting on top of an invalid HTML document won't make your life easier (obviously). I'd try to replace spaces given by the user to _ in the backend. And then do what with underscores given by the user? Come on, that was just an idea. You can leave underscores the way they are for

Re: [jQuery] IDs of all checked checkboxes

2007-01-11 Thread Michael Geary
var a[]; $(':checkbox').each(function() { if (this.id) a.push(this.id); }); I get this error: missing ; before statement var a[]; (curse my rudimentary javascript skills!) OK... It says there is a missing ; before the statement var a[];. What is before the

Re: [jQuery] what's the difference between document.getElementById('id') and $('#id') ?

2007-01-16 Thread Michael Geary
(If there is a better way to look at the Object, please post here) The very best way to understand what JavaScript code is going and explore objects is to use any JavaScript debugger, such as Firebug or Venkman for Firefox, or the Microsoft Script Editor for IE. If you don't have a JavaScript

Re: [jQuery] what's the difference betweendocument.getElementById('id') and $('#id') ?

2007-01-16 Thread Michael Geary
Now that it is laid out in front of me it's pretty obvious, but when you come into the thing cold, these things are not obvious. I think it would be a good idea to explicitly state what the object is, and that $ refers to it (I think that's right ... now I mention it I'm not quite sure if

Re: [jQuery] Proper OOP paradigm / please be friendly

2007-01-17 Thread Michael Geary
// this is .n much too complicated! Guys, I don't appreciate the profanity. My 10 and 11 year old daughters are learning JavaScript. I don't want them to be subjected to language like that. When you've offended some people already, offending more is probably not the best way to fix it.

Re: [jQuery] Proper OOP paradigm / please be friendly

2007-01-17 Thread Michael Geary
Guys, I don't appreciate the profanity. My 10 and 11 year old daughters are learning JavaScript. I don't want them to be subjected to language like that. Just to clarify, my daughters don't actually read the jQuery list - yet. Their goal is to make an online computer game for some of their

[jQuery] Junior Programmers (RE: Proper OOP paradigm / please be friendly)

2007-01-17 Thread Michael Geary
From: Michael Geary Just to clarify, my daughters don't actually read the jQuery list - yet. Their goal is to make an online computer game for some of their friends to play. Right now they're just learning about variables and loops and a bit of HTML and CSS. Hopefully

Re: [jQuery] What tools should I use to troubleshoot jquery problems? (John Resig, jquery team, other gurus please share your tricks...)

2007-01-23 Thread Michael Geary
Is there a way to just return the jquery object (so I could see it in firebug's watch section) then pass it to another jquery function then join them all up when I know everything works? $('#test :textarea').before('Current length:nbsp;span id='+ this.id

Re: [jQuery] Trivial use

2007-01-23 Thread Michael Geary
The DOM updates immediately when you add new elements. But updating the DOM does not mean copying event handlers from deleted DOM elements to newly added DOM elements. That appears to be the problem here: You need to assign the click handler again after replacing the DOM element, because the click

Re: [jQuery] What tools should I use to troubleshoot jqueryproblems? (John Resig, jquery team, other gurus please share your tricks...)

2007-01-23 Thread Michael Geary
That's a nice trick, Jake - thanks for posting it! Both approaches have their use. Your log plugin is great for console logging, while breaking up the chain is great for interactive debugging because you can set a breakpoint between lines. -Mike Mike, I don't like breaking the chains... I just

Re: [jQuery] JQuery in Google Maps Info Windows

2007-01-24 Thread Michael Geary
I'm not very familiar with InnerFade, but wouldn't you do this inside your marker click handler, right after you call marker.openInfoWindowHtml? That's when you have the list items available. I'm new to jQuery and am trying to figure this out, but was wondering if anyone has had any luck

Re: [jQuery] OT: CSS Conditional Comments

2007-01-24 Thread Michael Geary
!-- ... - is an HTML comment, not a CSS comment. So, conditional comments go in your HTML code, not in CSS code. div.SiteHeader{ border: 1px solid #336566; /*AA*/ width: 850px; background-color: #E3F0D6; /*D5F0D5,CDD9E5*/ height: 60px; text-align: left; margin:

Re: [jQuery] OT: CSS Conditional Comments

2007-01-24 Thread Michael Geary
!-- ... - is an HTML comment, not a CSS comment. So, conditional comments go in your HTML code, not in CSS code. Michael, so that only works with inline styles? You can use them with any HTML code. Inline style tags, link tags, script tags, whatever. Do a View Source on www.zvents.com for

Re: [jQuery] External or anonymous function - which is best?

2007-01-25 Thread Michael Geary
$(document).ready(function(){ function resizeDiv(that){ var x = $(that); if(x.height() 600){ x.css(height,600px); } }; $(#mydiv).each(function(){resizeDiv(this)}); }); My question: is it better to define this function as above and pass this or to define an

Re: [jQuery] I broke it - Why is it doing this?

2007-01-26 Thread Michael Geary
When you create a named function is is basically a static object stored in funcname of the scope it was defined in. when you declare a var in a function it is also a static object attached to the function object. As such mydata is a single static object and effectively a single object in

Re: [jQuery] Custom borders

2007-01-30 Thread Michael Geary
$.fn.border = function(prefix){ var classNames = [ 'north', 'east', 'south', 'west', 'northeast', 'southeast', 'southwest', 'northwest']; return this.each(function(){ for (var index in classNames){ className = (prefix || '')+ classNames[index]; $(this).wrap(div

Re: [jQuery] Animate font weight

2007-02-01 Thread Michael Geary
I'm trying to get animate() to fade font-weight but it's not working. I've tried the following: $('a').mouseover(function() { $(this).animate({fontWeight: 'bold'}, 'slow'); }); But that doesn't work - I've also tried to put quotes around the fontWeight and tried font-weight. I get

Re: [jQuery] rewriting the browser address (without refresh)?

2007-02-02 Thread Michael Geary
If you change only the hash, it won't reload the page - but it won't create a unique URL for search engines. If you change anything else in the URL, it will reload the page. Changing the hash does get you a URL get people can copy and bookmark. But Google won't see the hash. It really is a case

Re: [jQuery] jQuery and Object Notation... confused with this

2007-02-04 Thread Michael Geary
Recently I've been trying to use ON with jQuery. I met with obstacle. I couldn't use this keyword in certain cases to get my main object reference... var myObject = { layout: { 'align': '' }, start: function() { $('form').bind('submit', this.buildLayout);

Re: [jQuery] Finding parent iframe?

2007-02-09 Thread Michael Geary
I have a quandary. I open an iframe with some arbitrary content in it. I want to be able to click on something within the iframe to cause the iframe (and the div tag that contains the iframe) to go away. I am having trouble getting to the iframe. I know it's possible as I've seen it

Re: [jQuery] Finding parent iframe?

2007-02-09 Thread Michael Geary
I was able to take what you sent me and simplify it down to this: var frameWindow = document.parentWindow || document.defaultView; var outerDiv = $(frameWindow.frameElement.parentNode); cls = $('div.tb_close', outerDiv).get(0); Because I actually want to operate on a

Re: [jQuery] iframe and designmode

2007-02-10 Thread Michael Geary
As you can see from your first (presumably working?) example, .contentWindow is a property of an HTML element. Therefore, the real question is, How do I get the HTML Element? If you are inside an $('foo').each() callback function, then this is the HTML element. So, you could use:

Re: [jQuery] Issues with non FF browsers

2007-02-12 Thread Michael Geary
I'm trying to get some simple things to work using jquery, and everything currently works the way I'd like it to in Firefox. However, in Opera, Safari, and Internet Explorer, nothing works right -- and I haven't been able to figure out where the hang up is. My entire jquery code can

Re: [jQuery] Issues with non FF browsers

2007-02-12 Thread Michael Geary
$.get(parser.php, { type: type, user: user, }, trailing commas only work in firefox! user: user, has a trailing comma! Great catch, Jake. Here's a tip - use ActiveState Komodo for your JavaScript editing, and get syntax checking as you

Re: [jQuery] how to simplify this

2007-02-12 Thread Michael Geary
There are several ways you could refactor that code. Here's one approach: $('#normal, #standard, #profi').click( function() { var idnums = { normal:1, standard:2, profi:3 }; $('#bereit').ScrollTo( 800 ); for( var id in idnums ) { var n = idnums[id];

Re: [jQuery] $.show() improvement

2007-02-14 Thread Michael Geary
What if I specify a div as display:inline in my css? Hiding then showing this div using the above script would change it's display to block. Good point! I was about to suggest making a list of the block level elements to avoid having to create DOM elements to test, but either approach would

Re: [jQuery] $.show() improvement

2007-02-14 Thread Michael Geary
elem.style.display=block when there is a speed designated. Plain .show() returns them to inline. On Feb 14, 2007, at 5:37 PM, Michael Geary wrote: The real problem here is that there is *no such thing* as showing an HTML element. All you can do is set it to block or inline. This suggests that show

Re: [jQuery] Id of a textarea element

2007-02-19 Thread Michael Geary
You may use a period in an id still being valid XHTML, but in this case you cannot use the id as a (CSS) selector, because the period is a class selector. I'm not convinced it's not a bug in jQuery because it doesn't make sense to specify a class on an Id. I'm not going to make a

Re: [jQuery] KICK-BUTT javascript based Zoom feature

2007-02-24 Thread Michael Geary
This is untested code, but it's one way you could do it with jQuery: $(function() { location = $('[EMAIL PROTECTED]')attr('href').replace( /_spam$/, '' ); }); _ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Christopher Jordan Sent: Saturday, February 24, 2007

Re: [jQuery] KICK-BUTT javascript based Zoom feature

2007-02-24 Thread Michael Geary
: [jQuery] KICK-BUTT javascript based Zoom feature Wow. that looks simple. I guess the jQuery core has everything else needed to produce the close-up effect? Rick From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Michael Geary Sent: Saturday, February 24, 2007 2:07 PM To: 'jQuery

Re: [jQuery] KICK-BUTT javascript based Zoom feature

2007-02-24 Thread Michael Geary
...and if I seem too much like a smart aleck today, my apologies! No offense intended. I was just having some fun with the juxtaposition of that URL is busted and anyone know how to accomplish this in jQuery... :-) _ From: Michael Geary The actual code for the close-up effect would

Re: [jQuery] .next() bug?

2007-02-28 Thread Michael Geary
Now, my mark-up is wrong. I should have wrapped the nested ul in it's own li, but I missed it. Testing looked good in FF 2, .next() was returning the nested ul, and I didn't even notice the problem. In IE6/7 however, .next() returned the next li, and not the ul which was in fact next

Re: [jQuery] compare between display and visibility when hide anelement?

2007-03-06 Thread Michael Geary
Nothing to do with SEO. The display and visibility properties do two different things: http://www.w3.org/TR/CSS21/visuren.html#display-prop http://www.w3.org/TR/CSS21/visufx.html#visibility -Mike _ From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Microtoby Sent:

Re: [jQuery] Dynamically change Document title

2007-03-08 Thread Michael Geary
Is there a way to change the title of a document after an ajax Call. I'm using an ajax history system and I would like to view specific document title in the back button list. I've try this but doesn't seem to work : $(title).html(Dynamic Title); I can see the change in

Re: [jQuery] Advantages of adding functions to jQuery

2007-03-14 Thread Michael Geary
I'm having trouble seeing the advantage of adding static functions to jQuery as in: jQuery.log = { error : function() { ... }, warning : function() { ... }, debug : function() { ... }, }; as opposed to: function log() { ... } log.prototype.error = function() { ... }

Re: [jQuery] window.undefined = undefinedundefined?

2007-03-15 Thread Michael Geary
I was poking around the DOM looking for incorrectly scoped variables and I found the following node: window.undefined = undefinedundefined What is this for? The window object has a property named undefined whose value is the undefined value. IOW, when you run code like this: if( foo

Re: [jQuery] json deserialization

2007-03-17 Thread Michael Geary
This works for me: $.ajax({ url: 'email.pl', type: post, data: { rm: 'deleteLetter', ID: myForm.letterSelect.value }, dataType: 'json', success: function( ret ) { alert( ret.a ); } }); I believe the order in which you pass the

Re: [jQuery] Same-site Restrictions on Ajax: Does $.getScript help?

2007-03-26 Thread Michael Geary
I want to make a remote request to a different server than the current page is hosted on, in order to get JSON data (padded with a callback). This is typically handled by inserting script elements on the current page with the src as the remote URL, (Right?), but I couldn't find an easy

<    1   2