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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • BobBlock
    New Member
    • Jul 2009
    • 7

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

    The main page ("parent.htm l") has a link that ajaxloads a page ("page1.html ") into a div ("targetdiv" ) in the main page, like so:
    parent html:
    Code:
    $("#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:
    Code:
    $("#targetdiv").html(loading).load('page2.html');

    This does not work; "html(loadi ng)" 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.)
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Without all of the code, I can't say for sure, but can you not have this code in the parent page?

    Comment

    Working...