return false will stop the even from bubbling up to other elements and
it will prevent the default action from occurring. When you click on a
link, the default action is to follow the link to the new href. Using
return false prevents that from occurring.
Not sure what you mean by "resulting page." Do you mean that you have
JavaScript events bound to elements in your document, but after you
have new content inserted via ajax, the events aren't bound to to the
new elements that you've just inserted? If that's the case, this FAQ
topic should answer your question:
http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_Ajax_request.3F
Hope that helps.
--Karl
____________
Karl Swedberg
www.englishrules.com
www.learningjquery.com
On Sep 19, 2008, at 1:14 PM, light-blue wrote:
What does 'return false' do? I make an AJAX request from an HREF,
which works. But the resulting page needs Javascript to run on it. I
think 'return false' is preventing it. How do I fix that?
Here's what I've read so far from the Chaffer / Swedberg book: "If we
wish to halt both, we can return false from our event handler, which
is a shortcut for calling both. stopPropagation () and .preventDefault
() on the event."