Best Place for JavaScript in AJAX Requests

Best Place for JavaScript in AJAX Requests

Where in the code is the best place to put page specific JavaScript code when doing AJAX requests and transitions (both regular <a> links and <form> submissions)? From what I read, only the <body> of the request is used/replaced with such links so I assume <head> is a bad idea. Just in the <body> or <div data-role="page">? Just don't want it to get lost between requests. Thanks