Elitmiar
Elitmiar

Reputation: 36829

JQuery Ajax issue

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?

Upvotes: -1

Views: 117

Answers (1)

ctford
ctford

Reputation: 7297

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.

Upvotes: 2

Related Questions