> the docs say that load
>
> "Bind a function to the load event of each matched element."

But if you notice, the docs indicate there is more than one load
function.  The one you're quoting is a bind for the load "event".
You're invoking a load action directly for which the docs say:

    Load HTML from a remote file and inject it into the DOM.


> so this just loads myFile without and other function getting executed?
> loads it where? this is an element .... ie a button, a link or
> whatever ... how can you load an html file into it?

It loads the file into the jQuery selection.  For example:

$('#target').load('somefile.html')

will load somefile.html into #target and

$('.targets').load('somefile.html')

will load somefile.html into all of the elements with class attribute
of 'targets'.


If you're trying to attach this behavior to a button click then you
might consider something like this:

$('#myButton').click(function() {
    $('#myTarget').load('myfile.html' function() {
        alert('my callback');
    });
});

The above says: when myButton is clicked, load myfile.html into
myTarget and alert me when it's done.

Hope this helps.

Mike

_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to