[jQuery] Re: Noob question about wrapped sets
$(#myElement) returns jQuery object and $(#myElement)[0] returns DHTML object. Here is a sample on how to access alt attribute jQuery $(#myElement).attr(alt) vs DHTML $(#myElement)[0].alt Both code return the same value. Correct me if i am wrong, I think the DHTML version is faster than the jQuery one. On Jul 21, 8:07 am, nyte999 zend...@gmail.com wrote: Going through the tutorials on this website and others, I've found some syntax that I don't understand and is never explained. Usually wrapped sets look like this: $(#myElement) But once in a while they look like this $(#myElement)[0] Here are a few examples of it in use: $(div).index($(div#myDiv)[0]); $(#myImage)[0].alt; I don't get it. The sample code is NEVER trying to find the first element of an array. From my POV this format seems completely random and unnecessary, yet the jQuery code will NOT work if the [0] is removed. I know it's something glaringly obvious and I'll feel stupid when I get the answer, but my god, I just can't figure out the pattern here. Please help.
[jQuery] Re: Noob question about wrapped sets
Thank you Jules! I thought that *might* be the case, but seeing the tell-tail jQuery code in the DHTML was a little confusing to me. But yes, I think I understand it now. alt is a normal JavaScript object, NOT jQuery. So when accessing JS objects I must always use the [0]. This also seems to apply when initializing a variable, as in var myVariable = $(#myElement)[0]; Thanks again! On Jul 20, 4:25 pm, Jules jwira...@gmail.com wrote: $(#myElement) returns jQuery object and $(#myElement)[0] returns DHTML object. Here is a sample on how to access alt attribute jQuery $(#myElement).attr(alt) vs DHTML $(#myElement)[0].alt Both code return the same value. Correct me if i am wrong, I think the DHTML version is faster than the jQuery one. On Jul 21, 8:07 am, nyte999 zend...@gmail.com wrote: Going through the tutorials on this website and others, I've found some syntax that I don't understand and is never explained. Usually wrapped sets look like this: $(#myElement) But once in a while they look like this $(#myElement)[0] Here are a few examples of it in use: $(div).index($(div#myDiv)[0]); $(#myImage)[0].alt; I don't get it. The sample code is NEVER trying to find the first element of an array. From my POV this format seems completely random and unnecessary, yet the jQuery code will NOT work if the [0] is removed. I know it's something glaringly obvious and I'll feel stupid when I get the answer, but my god, I just can't figure out the pattern here. Please help.
[jQuery] Re: noob question, computability issues with a different date picker
can't understand what you say.sorry. 2009/7/9 labbit nick@gmail.com Hello everyone, I tried posting a message before, but it didn't get posted, so here's another go. I'm completely new to jquery development and I wanted to use this date picker, since it also uses time as well http://razum.si/jQuery-calendar/TimeCalendar.html However, it did not say what to do, how, or where to change or add the code of his particular date picker with the standard one given in the UI code provided (his code is given through page source, then at top, the jquery.js and jquery-calendar.js files) . Is there a viable solution to getting his code working to get the calendar and time picker? Also, does the fact that his jquery.js file is running 1.1.2 make a difference. If my last message got posted, I apologize for double posting
[jQuery] Re: noob question
Hi bart, let me cite from the spec: get(): Access all matched DOM elements. This serves as a backwards- compatible way of accessing all matched elements (other than the jQuery object itself, which is, in fact, an array of elements). It is useful if you need to operate on the DOM elements themselves instead of using built-in jQuery functions. .get() returns DOM elements not a jQuery object where all the magic stuff happens. To match the first element in a jQuery you need to do: // either this $('p.fl').eq(0).css('background','red'); // or this $('p.fl').slice(0,1).css('background','red'); // or this $('p.fl:first').css('background','red'); There's a couple of other ways to do that but I guess this is enough. -- Bohdan On Jan 30, 5:31 pm, bart b...@ivwd.nl wrote: Somehow I don't get the concept of get() right. The following expression gives an error; $('p.fl').get(0).css('background', 'red'); Now what I'm trying to do here is select the first paragraph from all the paragraphs with a class of fl. After that I'm just trying to get a visual id by making it red but it's more about grabbing the element really. There's probably a very good reason why this doesn't work but what I understand from documentation this should work? This ultimate goal is to hide a paragraph based on it's index. This index is gotten from a clicked link. So far I've got this, but it's stuck on the get() part. $('a.leesmeer').click(function() { var nmbr = $('a.leesmeer').index(this); $('p.fl').get(nmbr).hide(); $('div.case').get(nmbr).show(); return false; });
[jQuery] Re: noob question: loading dynamic content with .load()
If the callback runs but the data isn't loaded it's almost certainly a server error. What is in your responseText when it fails? On Nov 4, 10:34 pm, HiddenPhoenix [EMAIL PROTECTED] wrote: im kinda a noob with some of this jquery stuff. esp the ajax stuff so any help i can get here would be greatly appreciated. i am using this code to try to load new content into my content div. $(myContentDiv).load(myScript.php?var1=xvar2=yvar3=z) myScript.php generates my new content to load into my Div. there can be anywhere from 0 to 1000 rows of data returned. sometimes myScript doesnt load correctly. even if i add a callback, the callback runs but the data doesnt load. Is it best for me to have myScript.php generate all the html and then have it loaded into myDiv or is there a better way. thx for helping this noob.
[jQuery] Re: Noob question about accessing element contents
This forum is about using jQuery, thus I assumed that I didn't have to spell out that I indeed of course meant the best jquery way. Thank you for your answer.
[jQuery] Re: Noob question about accessing element contents
$('item', xml).eq(1).text() - Richard On Wed, Jul 2, 2008 at 11:51 AM, ml1 [EMAIL PROTECTED] wrote: I'm trying to find out the best practice for getting the contents of one particular element. I know about the each() call. As I said I can use ways that seem not so efficient to get the contents of a single element but I want to know the best way. On Jul 1, 5:20 pm, Mike Alsup [EMAIL PROTECTED] wrote: I am using jquery to parse some xml. I'm looking for the best practice to access an elements text contents. Let's say my xml looks like this: items item Hello world! /item item Goodnight moon! /item items I can get a wrapped set of the elements this way: $('items item', xml) And I can get the text of element 1 this way: $('items item:eq(1)', xml).text() But how do I get the contents once I am directly accessing the element instead of the jquery object? In other words I'd like to do something like this: $('items item', xml)[1].text(), but since the element that's returned from the array [] doesn't support text() how do I get it's contents? I know I can wrap it in a second $ call, as in $($('items item', xml) [1]).text() but that seems less than ideal. Why do you need to access the element? Are you trying to get the contents of each 'item'? If so, here's a way to do that: $('items item').each(i,o) { // in this loop 'i' is the index of the loop iteration // and 'o' is the object of the iteration (item element in this case) var $item = $(o); // could also do: var $item = $(this); var txt = $item.text(); });
[jQuery] Re: Noob question about accessing element contents
Let's say you've got the element stored in a variable as an XMLElement, then it would be a simple matter to refer to the jQuery object of the element itself, for example, for variable elem: $(elem,xml).text() On Jul 2, 12:10 pm, Richard D. Worth [EMAIL PROTECTED] wrote: $('item', xml).eq(1).text() - Richard On Wed, Jul 2, 2008 at 11:51 AM, ml1 [EMAIL PROTECTED] wrote: I'm trying to find out the best practice for getting the contents of one particular element. I know about the each() call. As I said I can use ways that seem not so efficient to get the contents of a single element but I want to know the best way. On Jul 1, 5:20 pm, Mike Alsup [EMAIL PROTECTED] wrote: I am using jquery to parse some xml. I'm looking for the best practice to access an elements text contents. Let's say my xml looks like this: items item Hello world! /item item Goodnight moon! /item items I can get a wrapped set of the elements this way: $('items item', xml) And I can get the text of element 1 this way: $('items item:eq(1)', xml).text() But how do I get the contents once I am directly accessing the element instead of the jquery object? In other words I'd like to do something like this: $('items item', xml)[1].text(), but since the element that's returned from the array [] doesn't support text() how do I get it's contents? I know I can wrap it in a second $ call, as in $($('items item', xml) [1]).text() but that seems less than ideal. Why do you need to access the element? Are you trying to get the contents of each 'item'? If so, here's a way to do that: $('items item').each(i,o) { // in this loop 'i' is the index of the loop iteration // and 'o' is the object of the iteration (item element in this case) var $item = $(o); // could also do: var $item = $(this); var txt = $item.text(); });
[jQuery] Re: Noob question about accessing element contents
This forum is about using jQuery, so our answers will usually be focused on the best JQUERY way, not necessarily the BEST way. On Jul 2, 11:51 am, ml1 [EMAIL PROTECTED] wrote: I'm trying to find out the best practice for getting the contents of one particular element. I know about the each() call. As I said I can use ways that seem not so efficient to get the contents of a single element but I want to know the best way. On Jul 1, 5:20 pm, Mike Alsup [EMAIL PROTECTED] wrote: I am using jquery to parse some xml. I'm looking for the best practice to access an elements text contents. Let's say my xml looks like this: items item Hello world! /item item Goodnight moon! /item items I can get a wrapped set of the elements this way: $('items item', xml) And I can get the text of element 1 this way: $('items item:eq(1)', xml).text() But how do I get the contents once I am directly accessing the element instead of the jquery object? In other words I'd like to do something like this: $('items item', xml)[1].text(), but since the element that’s returned from the array [] doesn’t support text() how do I get it’s contents? I know I can wrap it in a second $ call, as in $($('items item', xml) [1]).text() but that seems less than ideal. Why do you need to access the element? Are you trying to get the contents of each 'item'? If so, here's a way to do that: $('items item').each(i,o) { // in this loop 'i' is the index of the loop iteration // and 'o' is the object of the iteration (item element in this case) var $item = $(o); // could also do: var $item = $(this); var txt = $item.text(); });
[jQuery] Re: Noob question about accessing element contents
I am using jquery to parse some xml. I'm looking for the best practice to access an elements text contents. Let's say my xml looks like this: items item Hello world! /item item Goodnight moon! /item items I can get a wrapped set of the elements this way: $('items item', xml) And I can get the text of element 1 this way: $('items item:eq(1)', xml).text() But how do I get the contents once I am directly accessing the element instead of the jquery object? In other words I'd like to do something like this: $('items item', xml)[1].text(), but since the element that’s returned from the array [] doesn’t support text() how do I get it’s contents? I know I can wrap it in a second $ call, as in $($('items item', xml) [1]).text() but that seems less than ideal. Why do you need to access the element? Are you trying to get the contents of each 'item'? If so, here's a way to do that: $('items item').each(i,o) { // in this loop 'i' is the index of the loop iteration // and 'o' is the object of the iteration (item element in this case) var $item = $(o); // could also do: var $item = $(this); var txt = $item.text(); });
[jQuery] Re: Noob Question: Using Selectors after ajax load
Thanks a lot for the help! Really appreciate it -Eric
[jQuery] Re: Noob Question: Using Selectors after ajax load
What is the structure of the page you are loading into your div? Could it be that the new content is causing problems, like duplicate id's, and that is causing the inability to find elements? On Jun 25, 10:22 am, Eric [EMAIL PROTECTED] wrote: I am sure this has been answered before, but I could not find it. I click on a link which loads a second page into a div using the load function $(document).ready( function() { $(.actions a).bind (click, function () { $(#ajax_div).load($(this).attr(href)); return false; } ) $('#SampleCustDue, #SampleCustReq, #SampleVendorReq, #SampleVendorActual, #SampleVendorRec, #SampleCustShip, #SampleCustApprove, #SampleVendorApprove').datepicker(); }); The page that is being loaded has several text fields that I am using the date picker plugin for (#SampleCustDue etc...) The problem is that the selectors are not finding these fields after the page has been loaded in the #ajax_div. My guess is that the page needs to be re-indexed, but I cannot find a function to do that. My other attempt was to create a new $(document).ready() function in the page that was being loaded via ajax, but that never seemed to get called. Any ideas? Thanks in advance!
[jQuery] Re: Noob Question: Using Selectors after ajax load
Take a look at http://brandonaaron.net/docs/livequery/ On Jun 25, 12:22 pm, Eric [EMAIL PROTECTED] wrote: I am sure this has been answered before, but I could not find it. I click on a link which loads a second page into a div using the load function $(document).ready( function() { $(.actions a).bind (click, function () { $(#ajax_div).load($(this).attr(href)); return false; } ) $('#SampleCustDue, #SampleCustReq, #SampleVendorReq, #SampleVendorActual, #SampleVendorRec, #SampleCustShip, #SampleCustApprove, #SampleVendorApprove').datepicker(); }); The page that is being loaded has several text fields that I am using the date picker plugin for (#SampleCustDue etc...) The problem is that the selectors are not finding these fields after the page has been loaded in the #ajax_div. My guess is that the page needs to be re-indexed, but I cannot find a function to do that. My other attempt was to create a new $(document).ready() function in the page that was being loaded via ajax, but that never seemed to get called. Any ideas? Thanks in advance!
[jQuery] Re: noob question: how to close current visible DD in this script
Thanks, that looks like it does the job! Looks quite easy to adapt to my requirements. Cheers, Adrian On Nov 30, 6:41 pm, Glen Lipka [EMAIL PROTECTED] wrote: I made this a while back.http://www.commadot.com/jquery/faq.php I think it does what you want. You can change the markup to be DD/DT pretty easily. Glen On Nov 30, 2007 8:47 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Ladies and Gentlemen, Here goes my complete noob question: I have this demo page: http://www.itchycloud.co.uk/panther/ in which I'm using this jquery script: $(document).ready(function(){ $(dd:not(:first)).hide(); $(dt a).click(function(){ $(dd:visible).slideUp(slow); $(this).parent().next().slideDown(slow); return false; }); }); which I found on sniplr: http://snipplr.com/view/2208/jquery-collapsible-sidebar-menu/ I would like to modify this script so that when the user clicks on the current active - displayed, open - DTA then the appropriate DD will collapse/hide. I suppose it should be something like this in pseudo-code: if current.DT is the previous sibling of current visible DD then click function() will close DD; else click function() will open next sibling DD Basically, when there is a lot of content in a given DD I want the user to be able to click on the previous sibling DT A and it will close that DD. This will prevent a lot of scrolling with some pages on the planned website. TIA for your help. I am really looking forward to learning javascript and jquery, Adrian
[jQuery] Re: noob question: how to close current visible DD in this script
I made this a while back. http://www.commadot.com/jquery/faq.php I think it does what you want. You can change the markup to be DD/DT pretty easily. Glen On Nov 30, 2007 8:47 AM, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Ladies and Gentlemen, Here goes my complete noob question: I have this demo page: http://www.itchycloud.co.uk/panther/ in which I'm using this jquery script: $(document).ready(function(){ $(dd:not(:first)).hide(); $(dt a).click(function(){ $(dd:visible).slideUp(slow); $(this).parent().next().slideDown(slow); return false; }); }); which I found on sniplr: http://snipplr.com/view/2208/jquery-collapsible-sidebar-menu/ I would like to modify this script so that when the user clicks on the current active - displayed, open - DTA then the appropriate DD will collapse/hide. I suppose it should be something like this in pseudo-code: if current.DT is the previous sibling of current visible DD then click function() will close DD; else click function() will open next sibling DD Basically, when there is a lot of content in a given DD I want the user to be able to click on the previous sibling DT A and it will close that DD. This will prevent a lot of scrolling with some pages on the planned website. TIA for your help. I am really looking forward to learning javascript and jquery, Adrian
[jQuery] Re: Noob question: How to access a PHP variable and append it to the html?
Your best approach would be to write a PHP script that serves data in XML or JSON format and then invoke the script from a $.ajax call in jQuery. Then you process the data you get back and insert it into your document as appropriate. Sorry for being vague, but without more information that's the best I can do. On Nov 29, 9:34 pm, Action [EMAIL PROTECTED] wrote: I have a PHP array of data I want to be able to append to the html using jquery and ajax. I want to be able to add different elements of the array to different parts of the page. How can I go about doing this?
[jQuery] Re: Noob question: How to access a PHP variable and append it to the html?
There are a lot of way to take data via ajax. I always use this one: Client side: data = param1=fooparam2=bar $.ajax({ type: POST, url: ajax.php, data: data, dataType: json, success: function(data_result) { FillResult(data_result) } // on success the FillResult will be fired passing the result data from the php call }); function FillResult(data) { $('#divtofill').html(data.param1+br /+data.param2); } on server side: ?php $param1 = $_POST['param1']; // here you have to check if in post there is the data you expect for security reasons $param2 = $_POST['param2']; // here you have to check if in post there is the data you expect for security reasons // then you can retrieve your data in the way you want, I'm going to return the posted data json_encode($_POST); // this function comes from the json php extension, which is included by default in php5, in php4 you can find it via PECL. ? Hope this help. Bye On Nov 29, 10:34 pm, Action [EMAIL PROTECTED] wrote: I have a PHP array of data I want to be able to append to the html using jquery and ajax. I want to be able to add different elements of the array to different parts of the page. How can I go about doing this?
[jQuery] Re: Noob question: How to access a PHP variable and append it to the html?
On Nov 30, 5:55 am, Action [EMAIL PROTECTED] wrote: On Nov 29, 8:02 pm, Wizzud [EMAIL PROTECTED] wrote: For example ... ? Sorry, maybe that was a bit too cryptic. Can you provide an example of your PHP data? Can you provide examples of the before/after affected HTML? Can you provide _any_ further information? As you can probably tell from the other responses received so far, your question is too general for anyone to be able to provide more than a vague guess at what you _could_ do. There are all sorts of different ways of going about this sort of thing, most of which could probably be ruled out as not applicable to your particular situation ... *if* we knew more about it! On Nov 29, 9:34 pm, Action [EMAIL PROTECTED] wrote: I have a PHP array of data I want to be able to append to the html using jquery and ajax. I want to be able to add different elements of the array to different parts of the page. How can I go about doing this?
[jQuery] Re: Noob question: How to access a PHP variable and append it to the html?
For example ... ? On Nov 29, 9:34 pm, Action [EMAIL PROTECTED] wrote: I have a PHP array of data I want to be able to append to the html using jquery and ajax. I want to be able to add different elements of the array to different parts of the page. How can I go about doing this?
[jQuery] Re: Noob question: How to access a PHP variable and append it to the html?
On Nov 29, 8:02 pm, Wizzud [EMAIL PROTECTED] wrote: For example ... ? On Nov 29, 9:34 pm, Action [EMAIL PROTECTED] wrote: I have a PHP array of data I want to be able to append to the html using jquery and ajax. I want to be able to add different elements of the array to different parts of the page. How can I go about doing this?
[jQuery] Re: Noob question: How to access a PHP variable and append it to the html?
hi you can do it this way $document({ $(div#mydiv).html(No of Users: + ?php echo $users; ?); }) On Nov 30, 12:55 am, Action [EMAIL PROTECTED] wrote: On Nov 29, 8:02 pm, Wizzud [EMAIL PROTECTED] wrote: For example ... ? On Nov 29, 9:34 pm, Action [EMAIL PROTECTED] wrote: I have a PHP array of data I want to be able to append to the html using jquery and ajax. I want to be able to add different elements of the array to different parts of the page. How can I go about doing this?- Hide quoted text - - Show quoted text -
[jQuery] Re: Noob Question - .add() not working in IE?
Hi John, thanks for the info, I'll try that. But it seems that there is another problem, because the part where the .attr(style) thing is checked, depends on the link beiing generated, wich does not happen in IE. The result of the code in IE is h3img / Text/h3 (which is the static html code) in Firefox and Safari (didn't checked with Opera) it is h3aimg /img /Text spananother Text/span/h3 (static code plus the 'inserted' code through jQuery) - Tom On 25 Jul., 20:39, John Resig [EMAIL PROTECTED] wrote: This is going to be an issue: .attr(style) == display: none; Up until just the other day, that wasn't working in IE (it's fixed now, and it will be in jQuery 1.1.4). In the meantime I recommend that you do: .is(:hidden) or: .css(display) == none --John On 7/24/07, webrocker [EMAIL PROTECTED] wrote: Hello group, I try to dynamically add some tags and content to an existing element (basically a toggle-link, that's only to be seen if JS is active and that slideToggles a div). Somehow my code doesn't work in IE, although it works fine in other browsers like Firefox or Safari: +++ JQuery: $(document).ready(function(){ // hide div on pageready: if( $(div.reduction-wrap) ){ $(div.reduction-wrap).hide(); // add toggle link with icon to headline with( $(#toggle-link) ){ children('img').append('img src=images/pfeil-blau-r.gif id=toggle-icon alt='); append(' spanshow/span'); html( 'a href=javascript:; id=reduction-toggle'+$(#toggle- link).html()+'/a'); } // click on link toggles hidden div: $(#reduction-toggle).click( function() { $(div.reduction-wrap).slideToggle(normal, function(){ if( $(div.reduction-wrap).attr(style) == display: none;) { $(#reduction-toggle).children(span).html(show); $(#toggle-icon).attr({src:images/pfeil-blau-r.gif, id: toggle-icon, alt: }); } else { $(#reduction-toggle).children(span).html(hide); $(#toggle-icon).attr({src:images/pfeil-blau-u.gif, id: toggle-icon, alt: }); } }); // make sure nothing happens with the link: this.blur(); return false; }); } }); HTML: h3 id=toggle-linkimg src=images/icon-reductions.gif alt= / Title/h3 div class=reduction-wrapcontent/div +++ What is wrong with that? IE will hide the div, but no link-markup is inserted to the html. Thanks for any hint or shove in the right direction... Tom
[jQuery] Re: noob question - load function - dynamic content to slide in place
Glad to have pointed you in a good direction. On 7/24/07, tonywhite [EMAIL PROTECTED] wrote: Cool - I get it now. I found that my problem was really that the target div for inserting my HTML wasn't set to display:none; to begin with, so animating it to a block state was just not happening. Thanks for your response - I appreciate the group. On Jul 24, 11:08 am, Benjamin Sterling [EMAIL PROTECTED] wrote: Tony, try: (for an ID) $('#emptyDiv').load(externalHTML, function(){ $(this).slideDown('slow'); }); (for a class) $('.emptyDiv').load(externalHTML, function(){ $(this).slideDown('slow'); }); On 7/24/07, tonywhite [EMAIL PROTECTED] wrote: I'm new to jQuery and can't figure this one out. Instead of using an ajax get and innerHTML to load in external html, I can just use jQuery's load function: $(emptyDiv).load(externalHTMLFile); which I like! I would like to do is make better use of the graceful animations that jQuery has. I would prefer that the external HTML not show up so suddenly, but instead to slide or fade in place. It's not clear to me how to make that happen. I tried chaining, but by the time the content is loaded, the chained animation doesn't really do the trick: $emptyDiv).load(externalHTMLFile, function() {$emptyDiv.slideDown('slow');}); If you know of answer, please share. Thanks for any help. Tony -- Benjamin Sterlinghttp://www.KenzoMedia.comhttp://www.KenzoHosting.com -- Benjamin Sterling http://www.KenzoMedia.com http://www.KenzoHosting.com
[jQuery] Re: Noob Question - .add() not working in IE?
Sorry, it should of course read .append() not working in IE in the title of this post, not .add() not working in IE. :-/
[jQuery] Re: Noob Question - .add() not working in IE?
Sorry, it should of course read .append() not working in IE in the title of this post, not .add() not working in IE. :-/
[jQuery] Re: noob question - load function - dynamic content to slide in place
Tony, try: (for an ID) $('#emptyDiv').load(externalHTML, function(){ $(this).slideDown('slow'); }); (for a class) $('.emptyDiv').load(externalHTML, function(){ $(this).slideDown('slow'); }); On 7/24/07, tonywhite [EMAIL PROTECTED] wrote: I'm new to jQuery and can't figure this one out. Instead of using an ajax get and innerHTML to load in external html, I can just use jQuery's load function: $(emptyDiv).load(externalHTMLFile); which I like! I would like to do is make better use of the graceful animations that jQuery has. I would prefer that the external HTML not show up so suddenly, but instead to slide or fade in place. It's not clear to me how to make that happen. I tried chaining, but by the time the content is loaded, the chained animation doesn't really do the trick: $emptyDiv).load(externalHTMLFile, function() {$emptyDiv.slideDown('slow');}); If you know of answer, please share. Thanks for any help. Tony -- Benjamin Sterling http://www.KenzoMedia.com http://www.KenzoHosting.com
[jQuery] Re: noob question - load function - dynamic content to slide in place
Cool - I get it now. I found that my problem was really that the target div for inserting my HTML wasn't set to display:none; to begin with, so animating it to a block state was just not happening. Thanks for your response - I appreciate the group. On Jul 24, 11:08 am, Benjamin Sterling [EMAIL PROTECTED] wrote: Tony, try: (for an ID) $('#emptyDiv').load(externalHTML, function(){ $(this).slideDown('slow'); }); (for a class) $('.emptyDiv').load(externalHTML, function(){ $(this).slideDown('slow'); }); On 7/24/07, tonywhite [EMAIL PROTECTED] wrote: I'm new to jQuery and can't figure this one out. Instead of using an ajax get and innerHTML to load in external html, I can just use jQuery's load function: $(emptyDiv).load(externalHTMLFile); which I like! I would like to do is make better use of the graceful animations that jQuery has. I would prefer that the external HTML not show up so suddenly, but instead to slide or fade in place. It's not clear to me how to make that happen. I tried chaining, but by the time the content is loaded, the chained animation doesn't really do the trick: $emptyDiv).load(externalHTMLFile, function() {$emptyDiv.slideDown('slow');}); If you know of answer, please share. Thanks for any help. Tony -- Benjamin Sterlinghttp://www.KenzoMedia.comhttp://www.KenzoHosting.com