Re: [jQuery] Re: A different approach to parsing XML, and a little help on processing attributes more efficiently

2010-02-02 Thread Michael Geary
No worries on the XML vs. JSON. It's been interesting to watch your progress in refactoring the code. I hope it's useful for other people too. A few notes on the latest version... * Avoid using ALLCAPS or PARTIALcaps in a variable name. Many JavaScript programmers will think you intend such

Re: [jQuery] Re: A different approach to parsing XML, and a little help on processing attributes more efficiently

2010-02-02 Thread Michael Geary
Cool, it will be good to see your continued work. We may be among the last holdouts in this mailing list - but I figure since the thread started here we can carry on. BTW you may notice one bit of annoying repeated boilerplate in that last version. See how the callback functions for all the

Re: [jQuery] Re: A different approach to parsing XML, and a little help on processing attributes more efficiently

2010-02-02 Thread Michael Geary
( function( $inner ) { html.push( $inner.attr('label'), ': ', $inner.text(), 'br/' ); }); }); }); }); html.push( '/div' ); $('#container').append( html.join('') ); } On Tue, Feb 2, 2010 at 10:54 PM, Michael Geary m...@mg.to wrote

Re: [jQuery] A different approach to parsing XML, and a little help on processing attributes more efficiently

2010-01-28 Thread Michael Geary
Are you required to use XML? Why not use JSON and avoid all the parsing? If you have to use XML I can make some suggestions to speed up the code a bit. But let's see if that is a requirement or not first. -Mike On Thu, Jan 28, 2010 at 10:32 AM, augur 312...@gmail.com wrote: I spent a couple

Re: [jQuery] Re: A different approach to parsing XML, and a little help on processing attributes more efficiently

2010-01-28 Thread Michael Geary
No offense, but that code is really frightening. Not your fault though. JSON is not only much faster than all this XML/DOM garbage, but it is *much* easier to understand and use too! If you're coding JavaScript, you need to know how to use ordinary JavaScript objects and arrays, yes? If you

Re: [jQuery] how to get href value

2010-01-19 Thread Michael Geary
But that would give you the href for the first A element in the document, not necessarily the one you clicked. Going back to the OP's code, this.href would be the easiest way to get it: $(document).ready(function() { $(a).click(function(event) { alert( You clicked

Re: [jQuery] Passing in a parameter

2010-01-17 Thread Michael Geary
If your current code in the body tag is literally: onload=getStuff(data) then 'data' must be a global variable. You can reference this global variable directly in any of your JavaScript code. For example: $(document).ready( function() { getStuff( data ); }); If that's not exactly what your

Re: [jQuery] jQuery 1.4 cross domain post bug?

2010-01-15 Thread Michael Geary
You can't do a cross-domain POST, nor a cross-domain GET either. It doesn't matter what kind of data it returns, you can't do a POST at all. It's not a jQuery limitation; the browser won't allow it for any JavaScript code. Cross-domain JSONP works because it uses a dynamic script element, not a

Re: [jQuery] Actually deleting instead of .remove

2010-01-13 Thread Michael Geary
.remove() does remove the element from the document head or body, but that doesn't destroy it. It just makes it available for garbage collection - if there are no other references to the element. For example: var $div = $('divtest/div'); $div.appendTo('body'); $div.remove(); Here we've created

Re: [jQuery] javascript loaded via ajax

2010-01-13 Thread Michael Geary
Removing a script element just removes the script's *source code* from the DOM. It doesn't undo any actions that the script has already performed, such as defining functions or variables or creating other DOM elements. It doesn't change their availability for garbage collection at all. In your

Re: [jQuery] Re: Ajax forms help

2010-01-11 Thread Michael Geary
The JSON part of your server response looks fine if you take out the two line breaks - I assume those are just an artifact of posting with Outlook, and your actual JSON response is all on one line. But why does it have the HTML content repeated after the last } that closes the JSON data? You

Re: [jQuery] Accessing REST API via JQUERY?

2010-01-04 Thread Michael Geary
The remote XML API is not on the same domain as your page, is it? Then you can't do it. Browser cross-domain restrictions will not permit it. The only reason you can use getJSON for cross-domain requests is that it actually downloads executable JavaScript code with a dynamic script element, i.e.

Re: [jQuery] Not working for me in IE7, but works in IE8

2010-01-02 Thread Michael Geary
If I tell you the (possible) answer, will you turn off the music on the home page? :-) Karl Swedberg mentioned in another thread today that you may have trouble in IE6 if you try to set a background color on a TR. It has to be on the TD's instead. Maybe this is the case for IE7 too. So I would

Re: [jQuery] Not working for me in IE7, but works in IE8

2010-01-02 Thread Michael Geary
Just to clarify that thought, I really like the music a lot! I just don't like having it start playing automatically when I visit the home page. -Mike On Sat, Jan 2, 2010 at 1:56 AM, Michael Geary m...@mg.to wrote: If I tell you the (possible) answer, will you turn off the music on the home

Re: [jQuery] Re: Table striping still not working in IE7

2010-01-02 Thread Michael Geary
jQuery does have its own selector engine that is used in *jQuery selectors*. However, it does not add any capabilities that are not already there in *CSS selectors*. This is a jQuery selector: $('.foobar').whatever(); This is a CSS selector: style type=text/css .foobar { whatever } /style

Re: [jQuery] Re: jQuery does not stripe visible table rows correctly

2010-01-01 Thread Michael Geary
I wouldn't use either version. Instead, I would change your CSS from: tr.rowodd { background-color: #FFF; } tr.roweven { background-color: #F2F2F2; } to: tr { background-color: #FFF; } tr.roweven { background-color: #F2F2F2; } and then use just one line of jQuery code: $('#foobar

Re: [jQuery] Rebinding not working

2009-12-26 Thread Michael Geary
That .live() code wouldn't work because what you've really written is: var temp = exp_iphone_get_trans(); $('#transactions ul li a').live('click tap', temp); Now you can probably see what the problem is with that. By adding the () after the function name, you are *calling* the

Re: [jQuery] Re: js function to jQuery

2009-12-23 Thread Michael Geary
Unicorns are a mythical creature, and so is that use of parentheses. Could this be the syntax you were looking for? (function() { var $ = window.jQuery; $(#CollapseExpandTd).click( function() { $(#TreeviewTd).toggle(); $(#MenuBarTd).toggle(); }); })(); That puts all the

Re: [jQuery] Re: how to access elements with index in for-loop

2009-12-23 Thread Michael Geary
Don't sweat it, dude. First off, Eric didn't post the comment you're referring to. And if he had, I'd be inclined to cut him some slack. After all, Eric's English is *much* better than my Chinese (or whatever Eric's native language is). Second, we all post something once in a while that offends

Re: [jQuery] Re: Autosuggest breaks in ie7/8

2009-12-22 Thread Michael Geary
Sorry, but that's not right at all. There is no problem with using 'row' as a function parameter name in IE. We're veering into Cargo Cult Programming here, but it's not your fault, MorningZ. The problem is that we can't see the actual code that's going wrong, so we're all reduced to guessing.

Re: [jQuery] Re: Autosuggest breaks in ie7/8

2009-12-22 Thread Michael Geary
with replies of post code/ link whatever i suppose On Dec 22, 11:04 pm, Michael Geary m...@mg.to wrote: Sorry, but that's not right at all. There is no problem with using 'row' as a function parameter name in IE. We're veering into Cargo Cult Programming here, but it's not your

Re: [jQuery] Re: Autosuggest breaks in ie7/8

2009-12-22 Thread Michael Geary
, because you can only have one title tag in a document, and once the page is loaded you can't add another title tag. Lucky for the OP, someone followed up with a comment to the effect of, Dude! Ever hear of document.title? :-) -Mike On Tue, Dec 22, 2009 at 8:48 PM, Michael Geary m...@mg.to wrote

Re: [jQuery] setTimeout

2009-12-17 Thread Michael Geary
You are calling the lengthy jQuery chain *first* and then passing its result to setTimeout. Your code is equivalent to: var temp = $(['li.',o.hoverClass].join(''),this) .add(this) .not(not) .removeClass(o.hoverClass) .find('ul')

Re: [jQuery] Re: How to compare data in 2 jQuery data() elements

2009-12-17 Thread Michael Geary
I think you guys are making this too complicated. Just loop through the data properties: function dataChanged( a, b ) { for( var key in a ) if( a[key] != b[key] ) return true; return false; } if( dataChanged(o,n) ) {

Re: [jQuery] Re: setTimeout

2009-12-17 Thread Michael Geary
it output but the important code is not running like this. On 17 Dez., 18:21, Michael Geary m...@mg.to wrote: You are calling the lengthy jQuery chain *first* and then passing its result to setTimeout. Your code is equivalent to: var temp = $(['li.',o.hoverClass].join

Re: [jQuery] Re: setTimeout

2009-12-17 Thread Michael Geary
p.s. If there are extra blank lines in my code samples, those aren't intentional (especially not that one in the middle of the chain). Gmail is adding those for some reason! On Thu, Dec 17, 2009 at 1:19 PM, Michael Geary m...@mg.to wrote: I'm sorry, I should have spotted the major bug

Re: [jQuery] jQuery FullCalendar Fetch Events Optimization

2009-12-17 Thread Michael Geary
50 events should be like nothing. I suspect the problem may be that you're calling $('#calendar').fullCalendar('renderEvent', calevent, true); separately for each individual event. I'm not too familiar with the Full Calendar, but can you use the 'events' option described on this page:

Re: [jQuery] Re: running an onload code snippet only once

2009-12-16 Thread Michael Geary
$(document).ready( function() {} ) and $( function() {} ) are the same thing. The latter is just a shortcut to the former. If one is acting oddly, chances are that the other will too. Richard, $( function() {} ) should *never* call your function more than once. It definitely shouldn't call it

Re: [jQuery] Re: Debugging in IE

2009-12-16 Thread Michael Geary
I'm glad you fixed your problem, but I'm certain that the conclusion (IE has trouble with a chained ajax call) is wrong. In the code you posted in the other thread, the chained and non-chained versions are quite different. You didn't just cut the chain into parts: the non-chained version uses a

Re: [jQuery] Call from Javascript to jQuery javascript function

2009-12-16 Thread Michael Geary
In fact, within a single script tag, function definitions happen first, before any code in that script tag is executed. It would be perfectly valid to write: script type=text/javascript // will be run immediately, but *after* callit is defined callit(); // will be defined

Re: [jQuery] google.load issue

2009-12-16 Thread Michael Geary
Put your lines of code in separate script tags. google.load() uses document.write() to write a script tag into the document. This script tag is not executed until the current script tag exits. So your jQuery.noConflict() call is being executed before jQuery is loaded. If you break up the script

Re: [jQuery] Re: Return values

2009-12-14 Thread Michael Geary
Looks like we have two threads going on the same topic. :-) To give you a real code example, I'd need to see the code that makes use of that 'result' variable you're setting. Where is that code and what does it look like? The bottom line is simple: whatever the code is that uses the 'result'

Re: [jQuery] Re: Return values

2009-12-14 Thread Michael Geary
Its a lot of repetetive code int there that i havent made into fuctions yet so you know haha :) Thanks again :) George On 14 Dec, 18:15, Michael Geary m...@mg.to wrote: Looks like we have two threads going on the same topic. :-) To give you a real code example, I'd need to see

Re: [jQuery] Re: Can't get a block of HTML added to the DOM

2009-12-14 Thread Michael Geary
T.J., I think you're right on the money. Joseph, no need to wonder whether you've run into an issue with the .append() method. Instead, verify whether you actually have the right data on hand or not. Where you had this code: $('#somediv').append(html); Change it to: alert( html ); and see

Re: [jQuery] Re: Can't get a block of HTML added to the DOM

2009-12-14 Thread Michael Geary
Oh, wait a minute. You said the content *does* show up in the div. I think you need to post a link to a test page, so we can see what is actually happening. That would make it a lot easier to help troubleshoot. -Mike On Mon, Dec 14, 2009 at 2:15 PM, Michael Geary m...@mg.to wrote: T.J., I

Re: [jQuery] Can't get a block of HTML added to the DOM

2009-12-14 Thread Michael Geary
Wendi, just a tip to help you get the assistance you're looking for: Since your question doesn't seem to relate to the topic of this particular thread, people may not notice it. Could you re-post your question as a new post with its own title that summarizes the question? That will help people

Re: [jQuery] Can't get a block of HTML added to the DOM

2009-12-14 Thread Michael Geary
Good point, thanks for noticing that, Brian. This is a good example of why it's always helpful to post a link to a live test page instead of just a code snippet. Then we know what the actual code looks like and can see it run in the browser. -Mike On Mon, Dec 14, 2009 at 4:20 PM, brian

Re: [jQuery] delete / remove $.ajax() object ???

2009-12-14 Thread Michael Geary
can I do this best? Michael Geary m...@mg.to Wendi, just a tip to help you get the assistance you're looking for: Since your question doesn't seem to relate to the topic of this particular thread, people may not notice it.

Re: [jQuery] Re: proper way

2009-12-13 Thread Michael Geary
Actually the scope rules I described always apply to all JavaScript code, whether it uses jQuery or otherwise. They also apply to your $.ajax example. Consider your second version. You have a result variable declared outside your validator code. The success function is able to access this

Re: [jQuery] Re: proper way

2009-12-12 Thread Michael Geary
No, the two examples shouldn't work the same. They are both working exactly as expected. Let me slightly rewrite each version in a more step-by-step fashion and you will see why. The first version is equivalent to: $(function() { function handleClick() { clickFunction1(); }

Re: [jQuery] Re: proper way

2009-12-12 Thread Michael Geary
I think you've got it! By George you've got it! (With apologies both to you and to Rex Harrison and Audrey Hepburn!) What you describe is not the only way to do it, but it's certainly a good way. You just have to understand what variables a function has access to. Of course a function can

Re: [jQuery] Re: Ajax , Json, and error firing instead of success

2009-12-09 Thread Michael Geary
It's probably 'parsererror', not 'parseerror', right? If you search the jQuery source for 'parsererror', you will find the two places where that error can be thrown. That may shed a little light on it. Actually what I would do would be to start stripping down the JSON response until the error

Re: [jQuery] Re: Very Strange !!! The same HTML code works well, but append() it not !!!

2009-12-08 Thread Michael Geary
Eric, you really need to put up a test page so we can try actually loading it. Otherwise it's too hard to tell what might be wrong. I'm not even sure what the problem is we're supposed to be looking at! -Mike On Mon, Dec 7, 2009 at 11:44 PM, Eric Zhong ericiszhongwen...@gmail.comwrote: i have

Re: [jQuery] Re: Document undefined error

2009-12-08 Thread Michael Geary
No, there are no IE settings that need to be enabled. jQuery works with every modern browser out of the box. Loading a .js file directly from the browser address bar is not how it would ever be used in the context of a website, so no conclusions should be drawn from that experience. jQuery will

Re: [jQuery] Re: Very Strange !!! The same HTML code works well, but append() it not !!!

2009-12-08 Thread Michael Geary
what difference. 2009/12/8 Michael Geary m...@mg.to Eric, you really need to put up a test page so we can try actually loading it. Otherwise it's too hard to tell what might be wrong. I'm not even sure what the problem is we're supposed to be looking at! -Mike On Mon, Dec 7, 2009 at 11

Re: [jQuery] jQuery validation error: 'settings' is null or not an object

2009-12-08 Thread Michael Geary
It's pretty hard to tell what could possibly be wrong from just that code snippet. If you can post a link to a test page that demonstrates the problem, it will be much easier for someone to help. -Mike On Tue, Dec 8, 2009 at 10:17 AM, NovoGeek kris.techg...@gmail.com wrote: Hi all, I'm using

Re: [jQuery] Re: Ajax , Json, and error firing instead of success

2009-12-08 Thread Michael Geary
Yeah, the eval() is undoubtedly wrong, but that wouldn't be the issue here if it's never getting to the success callback. Is there any clue about the error in the arguments passed to the error callback? You have the wrong parameter list in that function. It takes three arguments as shown here:

Re: [jQuery] Tips and tricks for fixing memory leaks

2009-12-07 Thread Michael Geary
Minifying your code and removing unused code are good ways to reduce your initial memory footprint, but they won't have any effect on memory leaks. A memory leak is when the browser's memory use continues to increase, either as as you interact with a page or when you reload the page or navigate

Re: [jQuery] Re: Document undefined error

2009-12-07 Thread Michael Geary
I'd like to add one thing to Scott's very informative reply... You may wonder, But I wasn't trying to run the script from the Windows command prompt! I pasted it into the IE address bar and that's when I was prompted to open or save it. Like the doctor said, If that hurts, don't do it. The

Re: [jQuery] Ajax calls with jQuery

2009-12-07 Thread Michael Geary
We need to see something closer to a real-life example. There's a bit too much missing in the code you posted. In particular, what does the page look like when it actually has more than one row from your DB in it? I can't tell which part of your HTML would be repeated per row. What is the exact

Re: [jQuery] Re: Document undefined error

2009-12-07 Thread Michael Geary
is it that you'd like to know specifically? -Mike On Mon, Dec 7, 2009 at 11:11 AM, Michael Geary m...@mg.to wrote: I'd like to add one thing to Scott's very informative reply... You may wonder, But I wasn't trying to run the script from the Windows command prompt! I pasted it into the IE address bar

Re: [jQuery] Re: Very Strange !!! The same HTML code works well, but append() it not !!!

2009-12-07 Thread Michael Geary
Don't be so sure about that. I thought the same thing you did, but we were both wrong: you *can* write multline strings in JavaScript. Backslash-newline works inside a string just like it does outside one in normal JS code. You do have to be careful; there can't be any whitespace after the

Re: [jQuery] Re: Save javascript variable via jquery

2009-12-04 Thread Michael Geary
Your first example doesn't work because getJSON doesn't return the JSON data as its return value; it *calls a function* and passes the data as an argument to that function. Remember that getJSON is asynchronous. The call to getJSON returns before the data is even downloaded. Any time you have

Re: [jQuery] Re: Can I use $(document).ready(function(){ in the same page more than a once time in the same page

2009-12-04 Thread Michael Geary
It really makes little difference at all. jQuery makes an array of all your ready callbacks, and when the document is ready it loops through that array and calls each function. So other than that tiny bit of overhead, the net effect is exactly the same whether you put all the code in one ready

Re: [jQuery] IF. What am I doing wrong?

2009-12-03 Thread Michael Geary
How do you know the 'if' isn't working correctly? It doesn't play? At this point we don't know if the problem is with the 'if' statement itself or with the code inside it. Have you put another alert *inside* the if statement to verify whether it actually gets there or not? The 'if' statement is

Re: [jQuery] jQuery gives error on page in IE after hover.

2009-12-03 Thread Michael Geary
You're trying to use negative padding, but there is no such thing in CSS: http://www.google.com/search?q=negative+padding;http://www.google.com/search?q=%22negative+padding%22 Can you use negative margin instead, or some other technique? -Mike On Thu, Dec 3, 2009 at 4:51 AM, Duncan Krebbers

Re: [jQuery] Re: Problem with plugins

2009-12-02 Thread Michael Geary
guys are the best :P I didn't know this particularity about jQuery... it's logical though Thanks you all for the help and your time. Att. Paulo Henrique ;) On Dec 2, 4:09 am, Michael Geary m...@mg.to wrote: Don't feel bad. You made it easy for me. Since you'd already done some

Re: [jQuery] error essage: css is not a function

2009-12-02 Thread Michael Geary
The jQuery object - the return value from $(whatever) - is an array-like object with .length and [0] etc. properties. You don't need to call .get() on it unless you need an actual JavaScript Array object, which is rare. The *elements* of the jQuery object - or the elements of the Array that

Re: [jQuery] Best AJAX transfer method?

2009-12-02 Thread Michael Geary
JSON is far better for use in JavaScript. It's much easier to access JSON data, since by the time you see it, it's just ordinary JavaScript objects. It's more convenient and faster too. Regarding security, this is data that you're generating on your own server for use in your own website? Then

Re: [jQuery] Re: Problem with plugins

2009-12-01 Thread Michael Geary
click on it. This is one of the pages where i use plugins and they don't work... Just navigate around and check firebug console. Some pages are with php errors because they are incomplete, i haven't uploaded the most recent controllers... On Nov 30, 2:59 pm, Michael Geary m...@mg.to wrote

Re: [jQuery] Re: Problem with plugins

2009-12-01 Thread Michael Geary
a link to a test page. Without the test page, we were just taking wild guesses. Once the test page was posted, all it took was a couple of us taking a quick look at it, and bingo! -Mike On Tue, Dec 1, 2009 at 2:45 PM, Scott Sauyet scott.sau...@gmail.com wrote: On Dec 1, 5:31 pm, Michael Geary m

Re: [jQuery] Selector Help

2009-11-30 Thread Michael Geary
That's a nice solution. Let's make it easier to follow with some indentation: $('a.filter').click(function() { $(this) .closest('ul') .children() .removeClass('active') .end() .end() .closest('li')

Re: [jQuery] Re: Problem with plugins

2009-11-30 Thread Michael Geary
Could it be that you are also loading prototype.js or some other library that redefines the $() function? Does it find plugin methods if you use jQuery(...)... instead of $(...)...? Do the built-in jQuery methods show up? What does it display if you enter each of these lines into the Firebug

Re: [jQuery] Jquery specialist for hire

2009-11-30 Thread Michael Geary
There was a pretty good example posted here a few days ago that may have all the code you need: http://groups.google.com/group/jquery-en/msg/546500f34de23d79 The problem that Darjana was asking about shouldn't apply in your case; just be sure to use the full absolute URL to your Server 2.

Re: [jQuery] Re: $.getScript results in two requests!

2009-11-27 Thread Michael Geary
Glad you tracked that down - pretty nasty bug in Firebug! Just curious, 1.3 is still a pretty old version. Any reason not to use the latest Firebug 1.4.5? -Mike On Fri, Nov 27, 2009 at 2:43 AM, Eric ikeah...@gmail.com wrote: Hey there, Thanks for your answers. Sorry I didn't reply earlier,

Re: [jQuery] $.ajax and $.get

2009-11-27 Thread Michael Geary
If you would post a link to a test page, I'm sure someone can tell you what's wrong. Without that, we have to start playing 20 Questions. :-) First questions: 1) What is the response from the server in both cases? 2) Install Fiddler2 [*] and have it log the session. What does it show? -Mike

Re: [jQuery] IE balking at .siblings() - says 'Object does not support this property or method'

2009-11-26 Thread Michael Geary
The first thing that caught my eye looking at your code is the missing var on this line: lg_pic = $(this).siblings('.lg_pic_name').html(); Surely you don't want to be creating a global variable here? It should be: var lg_pic =

Re: [jQuery] Comparing or checking for a specific sub class?

2009-11-26 Thread Michael Geary
I think the method you're looking for is .not(): http://docs.jquery.com/Traversing/not Also, there is a shortcut for your mouseenter/mouseleave pattern called .hover(): http://docs.jquery.com/Events/hover If you look at the source code for .hover(), you can see that it is literally a wrapper

Re: [jQuery] Using add/remove class vs. show hide for a swap out section?

2009-11-25 Thread Michael Geary
It would really help if you could post a link to a test page instead of posting code excerpts. For example, I don't see any HTML code that has id=link-about and your other links. Is that missing from your page, or did you just omit it in the code you posted? Are the LI elements supposed to be

Re: [jQuery] Closure/scope

2009-11-24 Thread Michael Geary
The problem is in your setTimeout() call. When you pass a string argument to setTimeout(), that string is evaluated *in the global context*. Instead, pass a function to setTimeout() and that function will be executed in the scope you expect. Since you're just calling a single function anyway,

Re: [jQuery] Closure/scope

2009-11-24 Thread Michael Geary
message.replace( 'setTimeout', 'setInterval' ); :-) On Tue, Nov 24, 2009 at 10:30 AM, Michael Geary m...@mg.to wrote: The problem is in your setTimeout() call. When you pass a string argument to setTimeout(), that string is evaluated *in the global context*. Instead, pass a function

Re: [jQuery] Re: Closure/scope

2009-11-24 Thread Michael Geary
That code will certainly do the trick. Because your anonymous function expression simply calls crossfade(), you're essentially doing the same as this: cInterval = window.setInterval( crossfade, 5000 ); Well, there is a subtle difference. Your code below doesn't evaluate the name crossfade

Re: [jQuery] (this[0].ownerDocument || this[0]).createDocumentFragment is not a function

2009-11-24 Thread Michael Geary
You have too much of this. :-) Remember that every function you call may have a different this. Just because you had a this in an outer function with the value you want, it doesn't mean that some other function you call will have the same this - even if it's nested inside that outer function.

Re: [jQuery] $.getScript results in two requests!

2009-11-24 Thread Michael Geary
Can you post a link to a test page? Pretty hard to troubleshoot by just looking at the headers. Of course, someone will come along and troubleshoot it from the headers alone and prove me wrong! :-) -Mike On Tue, Nov 24, 2009 at 6:50 AM, Eric ikeah...@gmail.com wrote: Hey there, A

Re: [jQuery] Invalid argument jquery.min.1.3.2.js Code 0 IE7,IE8

2009-11-24 Thread Michael Geary
You found that this line is triggering the error: $(menu_node).css({left:-+total_widths+px}); But you haven't told us what the value of the total_widths variable at this point in the code. The content of that variable will reveal the problem. Also, there are a few things you can do to optimize

Re: [jQuery] Create a function?

2009-11-24 Thread Michael Geary
Your code could end up looking something like this: function setValidation( selector, validator ) { $(document).ready( function() { var $form = $(selector); $form.submit( function() { $form.validate( validator ); var valid = $(this).valid();

Re: [jQuery] Create a function?

2009-11-24 Thread Michael Geary
Ideas where I screwed up? Thanks again. Dave -Original Message- From: Michael Geary [mailto:m...@mg.to] Sent: November-24-09 10:02 PM To: jquery-en@googlegroups.com Subject: Re: [jQuery] Create a function? Your code could end up looking something like this: function setValidation

Re: [jQuery] Problem with $(document).ready in =IE7 only

2009-11-23 Thread Michael Geary
You don't need the language=javascript in the script tag; that isn't the problem. There is an extra comma at the end of the object literal in your infiniteCarousel({...}) call. See if removing that helps. Note that $(document).ready(function() { ... }); and $(function() { ... }); mean exactly

Re: [jQuery] How to Multiple wrap in Attribute level??

2009-11-22 Thread Michael Geary
You can't split up a tag like that. Whatever you pass into functions like prepend(), append(), or html() will be treated (if possible) as a complete tag. It would help to know *exactly* what result you are looking for. I'm guessing you want to have it end up like this: table tr

Re: [jQuery] Bolding a certain word - string manipulation?

2009-11-22 Thread Michael Geary
I wouldn't know what to suggest about the IE7 problem without seeing the code in action. Do you have a test page I can look at? -Mike On Sun, Nov 22, 2009 at 4:45 PM, Rua ra2a...@gmail.com wrote: Awesome thanks that works, but not in ie7? Michael Geary-3 wrote: If the word anything

Re: [jQuery] is this legal according to the jQuery license

2009-11-21 Thread Michael Geary
You're welcome to make any changes to jQuery that you want. You can use jQuery under the MIT license, which puts very few (almost no) restrictions on what you can do with it. Basically the only two restrictions are that you have to keep the copyright notice in the jQuery source code, and you can't

Re: [jQuery] Beginners problem with selectors

2009-11-21 Thread Michael Geary
So you are saying you want the entire last row of the outer table, not the last row of the inner table, is that right? IOW, what you want to get back is this row: trtdtest/tdtdtabletbodytrtdNew test/td/tr/tbody/table/td/tr If that's right, you're just missing a '' in your selector. Change it

Re: [jQuery] Problem with plugins

2009-11-19 Thread Michael Geary
Can you post a link to a test page? It's impossible to tell what is wrong from the .js file you attached. It's not even JavaScript code: it's PHP code. The browser doesn't ever see your PHP code. All it sees is the *output* of the PHP code. There could be any number of things wrong, but there's

Re: [jQuery] Can't get image's dimension under a hidden object

2009-11-19 Thread Michael Geary
I don't think even case 1 will work in all browsers. Some browsers won't bother loading the image if it has display:none. But they will all load it if it has visibility:hidden. Here's how I do it: jQuery.imageDimensions = function( src, callback ) { jQuery('img /') .css({

Re: [jQuery] Bolding a certain word - string manipulation?

2009-11-19 Thread Michael Geary
If the word anything is just part of the text inside the div, then it doesn't have a DOM element (tag) of its own. This means you can't select it with a jQuery selector or any kind of DOM manipulation, and you can't apply a CSS style to it. What you can do is rewrite the HTML content of your DIV

Re: [jQuery] AJAX w/dataType='json', doesn't correctly handle boolean response?

2009-11-19 Thread Michael Geary
You would normally expect that to work. What content-type is your server putting in the header for the JSON data? That could be throwing it off. Also note that a bare primitive value (true, false, null, or a string or number) is not valid JSON. The only valid JSON is either an object enclosed in

Re: [jQuery] Re: non well-formed

2009-11-18 Thread Michael Geary
false (and true) and numbers are valid JSON values. You *can* put them in quotes, but that changes their meaning: they become strings instead of boolean or numeric values. It's true that you would want to use the properties of the msg object such as msg.descrizione, but it's also fine to call

Re: [jQuery] Re: DOM changes takes effects only after function is done processing

2009-11-17 Thread Michael Geary
Here is how this really works: 1. Changes you make to the DOM always take effect immediately. If you make any change to the DOM and then immediately follow that with code that looks for your change, that code will indeed see the change. For example: $('#mydiv').html( 'hello' ); alert(

Re: [jQuery] Re: IE 7 error with $.getJSON data elements

2009-11-17 Thread Michael Geary
No, the scope of the data parameter is not the problem. The data parameter is already in scope inside your click handler. (Michel, check the code carefully - don't you agree? The click handler is nested inside the getJSON callback.) If it were broken in IE8 as well as IE7, then I would guess that

Re: [jQuery] Re: IE 7 error with $.getJSON data elements

2009-11-17 Thread Michael Geary
it is appending the full URL...any ideas how to get around this? Thanks, On Nov 17, 10:37 am, Michael Geary m...@mg.to wrote: No, the scope of the data parameter is not the problem. The data parameter is already in scope inside your click handler. (Michel, check the code carefully - don't you

Re: [jQuery] Re: How can i make a timer that i can stop with jquery?

2009-11-12 Thread Michael Geary
Now MorningZ, that is possibly the worst comparison of setInterval() and setTimeout() that I've ever seen! (Please take that as a little good-natured ribbing among friends, OK?) Both setInterval() and setTimeout() are cancelable, using clearInterval() and clearTimeout() respectively. The

Re: [jQuery] How can I store data from an AJAX function in a json-array?

2009-11-07 Thread Michael Geary
You shouldn't be thinking in terms of storing the JSON data in a variable for other functions to use. Instead, you should *call* those other functions from your success callback, and pass the JSON data as an argument to those functions. Remember that Ajax calls are asynchronous (the A in Ajax).

Re: [jQuery] Re: getJSON - need some direction please.

2009-11-07 Thread Michael Geary
Yeah, I though Michel's reply was a little snippy too. But that aside, he's right on the specific point that a synchronous Ajax call is to be avoided at all cost. It's even worse than he said: In a single-threaded browser like Firefox, *all* browser windows and tabs are locked up until your Ajax

Re: [jQuery] Re: How to call mouseover of the element in loop

2009-11-05 Thread Michael Geary
Avoid 'this'. In the setTimeout() callback, 'this' is the window object! Instead you can do: $('ul.News li').each(function( i, element ) { curTimeInterval += timeInterval; //alert(element.id); works here setTimeout(function() {

Re: [jQuery] Re: jQuery minified

2009-11-01 Thread Michael Geary
Thanks for posting the Google URL; that's good information. But name-calling and foul language are not welcome here. -Mike On Sun, Nov 1, 2009 at 1:17 PM, Joonha joonha.sebr...@gmail.com wrote: You nut bags forgot to mention to the noob, Use the AJAX hosted Google URL directly in your source

Re: [jQuery] licensing question

2009-10-30 Thread Michael Geary
You're talking about this page, right? http://docs.jquery.com/License I rewrote it to be more clear and to reflect the actual intent of the license. See if your patent attorney finds it more palatable now... Thanks, -Mike On Thu, Oct 29, 2009 at 3:35 PM, David Robertson

Re: [jQuery] How to prevent default behavior in an event handler that returns a function

2009-10-29 Thread Michael Geary
You mentioned not being able to pass the event object into your click function, but I don't see the code where you tried to do that, so I don't know what went wrong. In any case, the function-returning-a-function is much more complicated than you need. Risteli's code is on the right track, but it

[jQuery] Re: namespacing jQuery

2009-10-27 Thread Michael Geary
If your script tag that loads jQuery is immediately followed by another script tag that calls noConflict, there should be no race conditions. You're not putting the noConflict call inside a $(document).ready() or the like, are you? It should be directly executed in a script tag: script

[jQuery] Re: Unexpected $(document).ready() behavior when jQuery is loaded after the page

2009-10-26 Thread Michael Geary
If that's true, shouldn't my test case fail in Firefox? http://mg.to/test/jquery/dynamic-nightly/jquery-dynamic-onload.html The page does use a nightly from several weeks ago and I haven't tested with a more recent version - but hopefully it hasn't gotten broken since then. -Mike On Mon, Oct

[jQuery] Re: Variable within document ready... where is it in the DOM?

2009-10-24 Thread Michael Geary
The concept you're looking for is called a closure. Search for: javascript closure and you will find all sorts of information about closures. It really has nothing to do with jQuery or the DOM. Closures are part of the core JavaScript language and work in any environment where JavaScript is

  1   2   3   4   5   6   7   8   9   >