This has come up many many many times on this list. You need to put a
callback in the .load call, like this:

$('.galleryList').load("data.dat",function() {
   // Do bindings here
});

On 7/9/07, divinci <[EMAIL PROTECTED]> wrote:


Hi all, firstly let me thank you all for supporting such a great
library.  I am not the most adept programmer so I hope you will help
me out by explaining some of the workings of JQuery.

//// Script /////////////////////////
$('.galleryList').load("data.dat");

$('.gallerySelect').click(function(){
        var gallerySelected = $(this).parent('div');
        if( gallerySelected.attr('class')=='galleryOut' )
                {
                gallerySelected.removeClass();
                gallerySelected.addClass("galleryIn");
                } else {
                        gallerySelected.removeClass();
                        gallerySelected.addClass("galleryOut");
                        }
        });


//// Body /////////////////////////
<body>
        <div class="galleryList">

        </div>
</body>



//// data.dat /////////////////////////
<div class="galleryOut" id="101">
<div class="gallerySelect">A</div>
<div class="galleryContent">B</div>
<div class="galleryEdit">C</div>
</div>


My question is a simple one, I am loading data into the "galleryList"
div and then wish to manipulate it.  How can I load this data from an
external source and THEN have is answer to Jquery calls?

Thanks guys.


Reply via email to