0 Replies Latest reply on May 21, 2013 1:59 AM by Walkingforest

    Loading dynamically with jQuery .load()

    Walkingforest

      Hi!

      I have for the last two days tried to get this to work, but without success. I'm starting to believe that it's not possible to fix.

       

      I have a page with a content div, and I load files (ex: about.html) into it. Now, all the pages and animations loads and works perfectly the first time, but as soon as I use .load() again, no animation shows.

       

      This is a very simplified summary of the code

       

      <html>

      <head>

           <script src="edgePreload.js"></script>

      <head>

      <body>

           <div class="link" data-page="first_page">first page</div>

       

           <div class="content"></div>

       

           <script>

                $(".link").click(function(){

                     $(".content").load($(this).data("page")+".html");

                });

       

                $(".content").load("first_page.html");

           </script>

      <body>

       

      The first time you run the site, as I wrote before, the animations in "first_page.html" works fine. But as soon as you run .load() again (clicking on .link), all the compositions just isn't there.

       

      I've gone through google completely (It feels like it anyway) and I've read the api, specially the Coordinated Preloading part, but It wont help.

       

      What I think it is, is that the edge.1.5.0.min.js is stopping the anitmation to load more than once.

       

      Could someone give me any tips on what i could do to make this work?

       

      Thanks,
      Walkingforest