tags:

views:

65

answers:

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?

+2  A: 

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.

ctford
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
Roland
It was the problem, I removed the $(document).ready() and it worked :-) yeah man, thx for the insight
Roland