Evan, Andy, Scott, Karl-

Thank you for the replies.  One portion has been solved: getting at the
correct href w/o writing a bunch of functions.  The following does the
trick:

var href = $(this).attr('href');

I had previously tried simply using

$("#stand-summary").load(this.href)

but was unsuccessful.

Also thank you for pointing out the over-zealousness of my XPath solution
vs. a simple CSS selector solution.  Sometimes I get carried away with
writing "cool stuff" and don't think of the simple solution.  :-)

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

I didn't think this was the case, as it is simply requesting a flat HTML
file, and the path/name is identical to the "working" version.  I also
received no errors in FireBug - I thought (the page was reloading, so I
couldn't see it).  But I just opened FireBug and was playing around with the
code to see what, if anything would generate an error.  If I comment out the
.load() call, the responseText is appropriately returned from the server.
However, once I uncomment it, the following error is generated:

uncaught exception: [Exception... "Component returned failure code:
0x80070057 (NS_ERROR_ILLEGAL_VALUE) [nsIXMLHttpRequest.open]" nsresult:
"0x80070057 (NS_ERROR_ILLEGAL_VALUE)" location: "JS frame :: javascript:
eval(__firebugTemp__); :: anonymous :: line 1" data: no]

Any ideas as to what that is trying to tell me?

One other related question... According to the jQuery docs, you can set the
AJAX defaults by calling $.ajaxSetup().  In their example, they say that the
following code "Sets the defaults for AJAX requests to the url '/xmlhttp/'
.....".

$.ajaxSetup({
   url: "/xmlhttp/",
   global: false,
   type: "POST"
});

As I understand that statement, it means that I can now use $.ajax({ url: "
foo.htm" }) and jQuery will prepend "/xmlhttp/" to "foo.htm", as though I
had written $.ajax({ url: "/xmlhttp/foo.htm" }).  Am I correctly
understanding that?  I ask because I've written the following code, which
appears before the .click() block, but it does not seem to behave in this
manner.

$.ajaxSetup({
   url: "ajax/",
   global: false,
   type: "GET"
});

In FireBug, I get the dreaded 404 returned if I do not prepend the "ajax/"
to the url in my $.ajax() call.


Thanks again,

Matt

Reply via email to