0

I am playing around with djax when I click an anchor tag the url changes and when I view the page source it also changes but the page itself did not change its contents even if I view the page source it has change up any ideas why?

Here's a snippet of the markup

<body>

    <div id="resultContent" class='updatable'></div>
    <ul>
        <li><a id="thankyou" href="views/thankyou.jsp?menuId=2"
            targets="resultContent">Thank You Message</a></li>
    </ul>
</body>

When I click that the url changes but the result is not showing but when I view the page source it displays the proper markup(or should I say the markup of thankyou.jsp)

here is the code that Is js code

jQuery(document).ready(function($) {
    $('body').djax('.updatable');
});
user962206
  • 13,699
  • 56
  • 164
  • 259

1 Answers1

0

I've had the exact same problem as you and discovered your question while I was looking for an answer. It may be too late for you but according to your markup I believe you ran into the same problem as me which is actually on the issue-list of the plugins Github site (at least right now).

You need to place your updateable div inside a wrapping div. For some reason exchanging content seems not to work for direct children of body. See https://github.com/beezee/djax/issues/22

So your HTML should look like this

<body>
    <div id="djaxWrap>
        <div id="resultContent" class='updatable'></div>
        <ul>
            <li><a id="thankyou" href="views/thankyou.jsp?menuId=2"
        targets="resultContent">Thank You Message</a></li>
        </ul>
    </div>
</body>

While jQuery remains the same

jQuery(document).ready(function($) {
    $('body').djax('.updatable');
});
Major
  • 71
  • 2
  • 10