Can't really comment on the AJAX, because it could be a server side
error.

However, to dynamically determine the href, use the following:

$(document).ready(function() {
        $("//[EMAIL PROTECTED]//a").click(
                function() {
                        var href = $(this).attr('href'); // in this
case this refers to the anchor DOM element, so wrap it in a $() to
return a JQuery object and get he href
                        $("#stand-summary").load(href);
                        return false;
                }
        );

});

On Apr 9, 3:43 pm, "QuackFuzed" <[EMAIL PROTECTED]> wrote:
> Hello,
>
> After reading lots about jQuery on a number of CF blogs/lists, I've
> finally got a project that I think warrants me jumping into it.  I've
> only started going through the docs, etc a few hours ago, so I'm sure
> I'm overlooking something somewhere, but I have seen so many people
> brag about the wonderful community that is jQuery, and figured I'd
> give it a whirl.
>
> I am trying to create a simple ajax call.  I've tried a number of code
> combinations, but the only version I can get to "work" (e.g. load the
> file) is this:
>
> $(document).ready(function() {
>         $("//[EMAIL PROTECTED]//a").click(
>                 function() {
>                         $("#stand-summary").load("myfile.htm")
>                         return false
>                 }
>         );
>
> });
>
> In theory, I could write a number of blocks like this - one for each
> page I want to load - but that would pretty much defeat the purpose of
> using jQuery.  So, there are two things that I'm trying to solve here:
>
> 1) Dynamically get at the href attribute's value, and
> 2) Figure out how to properly use the $.ajax() method
>
> I have tried this code, which appears to be correct, based upon my
> obviously limited knowledge of jQuery, but does not provide the
> desired result.  It throws no errors in FireBug, but produces an empty
> string as the result...
>
> $(document).ready(function() {
>         $("//[EMAIL PROTECTED]//a").click(
>                 function() {
>                         var stuff = $.ajax({
>                            url: "myfile.htm"
>                            }).responseText
>                         $("#stand-summary").load(stuff)
>                         return false
>                 }
>         );
>
> });
>
> Any tips/pointers as to what I'm doing wrong would be tremendously
> appreciated.
>
> Thanks,
>
> Matt

Reply via email to