-1

I have this problem, I load a page using JQuery ajax, now within that page I also have a ajax submit form, somehow my ajax does not want to work on the second page, if I call that page directly the ajax works.

Is it possible to include ajax within ajax as description above?

1
  • 1
    Could you be more specific about what you mean by "loading" the second page? Are you using $.get() to load part of the page, loading the whole second page, changing document.location to point to the second page or something else? Commented Sep 22, 2009 at 16:35

1 Answer 1

2

When you load the second page via jQuery ajax, I presume you are only loading part of that second page into a div on the first page? Perhaps the ajax on the second page depends on something that is outside the portion of the page you are loading in.

The other possibility I can think of is that in $(document).ready() you are using jQuery to wire up events to all the forms on the page. If the second form is loaded after $(document).ready() has fired then the second form would be missing its events.

If you opened the second page directly in your browser then the event wiring would proceed correctly as the form would already be present on the page when $(document).ready() fired.

Sign up to request clarification or add additional context in comments.

2 Comments

That's correct, since the Jquery.js is included in the page, it makes perfect sense now, I'm going to try to remove the $(document).ready() and then check if it works then
It was the problem, I removed the $(document).ready() and it worked :-) yeah man, thx for the insight

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.