469,344 Members | 5,350 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,344 developers. It's quick & easy.

Making successive jQuery.load()s in nested pages work

The main page ("parent.html") has a link that ajaxloads a page ("page1.html") into a div ("targetdiv") in the main page, like so:
parent html:
Expand|Select|Wrap|Line Numbers
  1. $("#targetdiv").html(loading).load('page1.html');
This works fine and "page1.html" is loaded into "targetdiv".

The "page1.html" also has a link in it that is supposed to ajaxload another page ("page2.html") into "targetdiv" (onto itself), like so:
page1.html:
Expand|Select|Wrap|Line Numbers
  1. $("#targetdiv").html(loading).load('page2.html');
This does not work; "html(loading)" comes up in "targetdiv" and stays there, "page2.html" is not loaded.

If you're sure why this is so, tell me and I'll owe you a beer.

All the best...

(This page/site is not available on line.)
Apr 10 '10 #1
1 2506
acoder
16,027 Expert Mod 8TB
Without all of the code, I can't say for sure, but can you not have this code in the parent page?
Apr 29 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

7 posts views Thread by Sens Fan Happy In OH | last post: by
2 posts views Thread by John Bailey | last post: by
1 post views Thread by DuaneMoraes | last post: by
1 post views Thread by mikeh3275 | last post: by
26 posts views Thread by RobG | last post: by
2 posts views Thread by souporpower | last post: by
53 posts views Thread by souporpower | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.