Note that there are some explanatory texts on larger screens.

plurals
  1. POAjax not working with jquery Flip! plugin
    primarykey
    data
    text
    <p>I'm trying to use the FLIP! plugin and have it's content loaded by ajax. I'm running into a problem though. It's just not working. </p> <p>I can see the post event happening in firebug but nothing seems to change when I populate the "content" parameter inside the FLIP! plug in. </p> <p>Below is my code which may explain things better.</p> <pre><code>&lt;script type="text/javascript"&gt; function getFlipContent(url,command, target){ $.post(url, {"data": command}, function(response) { console.log(response); //return response; // this is not working replaceHtml(target,response); // workaround but kinda not really }); } function replaceHtml(object,html){ $(object).html(); $(object).html(html); } $(function(){ $(".flipable2").bind("click", function() { var url= $(this).data("url"); var command= $(this).data("command"); var target = $(this).data("target"); //alert(flip); if (target === undefined) { flip = "self"; } if (target == "self") { $($(this)).flip({ direction: 'lr', color: '#ffffff', content: function() { getFlipContent(url, command, target); } }); return false; } else { $(target).flip({ direction: 'lr', color: '#ffffff', content: function() { getFlipContent(url, command, target); } }); return false; } }); }); &lt;/script&gt; &lt;body&gt; &lt;div id="header"&gt; &lt;table width="100%" cellpadding="0px" border="0px" cellspacing="0px"&gt; &lt;tr&gt; &lt;td&gt;&lt;a href="#" class="flipable2 box" data-target="#page" data-url="test.php" data-command="test"&gt;FLIP&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; &lt;div id="page" class="box"&gt; BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH BLAH&lt;/td&gt; &lt;/div&gt; </code></pre> <p>SO right now I'm using a replachtml function to manually re-write the contents of the target I just "flipped". This sorta works but breaks the animation so I really would rather use the plugin's content parameter... When I do that though it just doesn't do anything. The animation completes but there is no content change. I think perhaps I am missing something. Any help would be welcome.</p> <p>Here is a jsfiddle too: <a href="http://jsfiddle.net/mUhuN/9/" rel="nofollow">http://jsfiddle.net/mUhuN/9/</a> though I wasn't sure how to fake an ajax request.</p> <p>Anyway please help :) </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload