Gregg, try $(document).ready instead of $('document').ready and see how that works.

-I can't figure out how to make a call from the loading page into the
loaded page; everything I try it seems the script functions from the
loaded page are not known by the DOM.

Check this link:
http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_Ajax_request.3F

-- Josh


----- Original Message ----- From: "gregg" <[EMAIL PROTECTED]>
To: "jQuery (English)" <jquery-en@googlegroups.com>
Sent: Wednesday, August 20, 2008 10:48 AM
Subject: [jQuery] calling functions inside pages loaded by AJAX



I'm admittedly new to JQuery, although I'm rather experienced
javascript programmer.

I have an application which uses JQuery to load an HTML page through
AJAX. I have logic, implemented as javascript functions, inside the
page being loaded which I'd like to invoke after the page load is
complete and the DOM is updated w/ all the HTML tags inside that page.
I can't figure out how to do this.

-I've tried using $('document').ready(...) within the loaded page; it
gets invoked before the DOM is accessible.
-I've tried using $(window).bind("load", function () { within the
loaded page; it never gets invoked.
-I can't figure out how to make a call from the loading page into the
loaded page; everything I try it seems the script functions from the
loaded page are not known by the DOM.

Does anyone have a good suggestion for how best to set this up?

Currently the loading page looks something like this:

   $("#myWin").load(url, function() {
       window.onPageLoad();  // this fails w/ object expected, or
objec does not suppor this method JS errors
    });


within the page being loaded I have something like this:
    function onPageLoad() {
       ....
    }

any help would be appreciated.

-Gregg

Reply via email to