I think this is the problem at hand. All my JavaScript is being ripped
from the page before being served up as AJAX. With this is mine, I've
cooked up a revision that still doesn't work.
First, some context: I'm using PHP to create several <div>s with
unique IDs in the form #thePane_[integer]. These are the boxes that
receive slideToggle(). As I said, it works when the page is accessed
directly, so I doubt it's PHP's fault.
In the <head> of the tabs page:
<script type="text/javascript">
$(document).ready(function(){
$("#theBox > ul").tabs();
$.getScript("[path]/pane.js");
});
</script>
And then pane.js:
$.getScript("[path]/jquery.js");
$(document).ready(function()
{
$(".paneTab").click(function()
{
var confID = this.id.match(/\d+$/);
$("#thePane_" + confID).slideToggle("slow");
});
});
Another idea: could this be relevant?
http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_AJAX_request.3F
On Sep 11, 3:58 am, Klaus Hartl <[EMAIL PROTECTED]> wrote:
> For me it always worked fine if I include the script - either external
> or as inline script - within the HTML *chunk* of the Ajax response.
>
> I emphasized chunk, because a common error is to serve complete
> documents as Ajax response with a head element that contains the
> script. Such script is then ignored because the browser will ignore
> another header element in an already existing document. As you're
> loading stuff into an existing document, you can only have HTML that
> can go into a body element there.
>
> If that's not the case you can try to use the load callback for the
> slideToggle stuff.
>
> -Klaus
>
> On Sep 11, 4:50 am, spamguy <[EMAIL PROTECTED]> wrote:
>
> > I have a main page with a few jQuery tabs, each of which summons
> > another page AJAX style. One of these tabs has further jQuery UI
> > elements (namely, slideToggle()). If the page is accessed directly
> > instead of through AJAX, slideToggle() works. If the page is accessed
> > through AJAX, slideToggle() doesn't work.
>
> > I've tried moving the snippet of JavaScript that defines slideToggle()
> > around both the main and AJAX-summoned pages, but it still doesn't
> > work as I'd like. Does anyone have any suggestions to make jQuery work
> > within an AJAX tab?
>
> > Thanks!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jQuery UI" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/jquery-ui?hl=en
-~----------~----~----~----~------~----~------~--~---