I have a list of links to posts on a page. When clicked, the link triggers a lightbox with a partial showing the post.
My problem:
1.) A user interacts with the lightbox and changes information about the post (favoriting, unfavoriting).
2.) User then closes the lightbox
3.) User reopens the lightbox by clicking on the link again. Lightbox information is NOT updated with the changes the user just made.
4.) But if the user refreshes the whole page Ctrl+R and clicks on the lightbox, the lightbox will reflect the new changes.
Lightbox I am using is FancyBox.
Link to Lightbox
<a class="fancyboxentry" rel="entries" target='_blank' href="#entryshow<%= thispost.id%>" onclick ="renderEntry<%=thispost.id%>()">
<%= image_tag(thispost.content_2)%>
</a>
Dummy div to hold loaded partial.
<div id="entryshow<%= thispost.id %>"> </div>
renderEntry function:
<script>
function renderEntry<%= thispost.id%>() {
$('#entryshow<%= thispost.id%>').html("<%=escape_javascript(render(:partial => 'posts/show', :locals => {:id => thispost.id})).html_safe %>");}
</script>
How can I get the partial to re-render, which means pulling new information from the database (checking whether it is favorited, new comments, etc) EVERY time the link is clicked? My current links seem to just cache old information until the page is refreshed.
I have the following Object: var obj = { "2014": {}, "2013": {}, "2012": {}, "description": null, "image": null }, objKeys = Object.keys(obj); //objKeys contains [ "2014", "2013", "2012", "...
I have the following Object: var obj = { "2014": {}, "2013": {}, "2012": {}, "description": null, "image": null }, objKeys = Object.keys(obj); //objKeys contains [ "2014", "2013", "2012", "...
I had the same problem this person: ShareThis plugin not working in FancyBox title But now I have gotten it work, except the afterShow: function(){ stButtons.locateElements(); } Where in this code ...
I had the same problem this person: ShareThis plugin not working in FancyBox title But now I have gotten it work, except the afterShow: function(){ stButtons.locateElements(); } Where in this code ...
I'm trying to group with kendo grid, but I am facing a problem with the default functionality of kendo grouping. Kendo grid groups the columns but it doesn't differ records of "USA" with "usa", these ...
I'm trying to group with kendo grid, but I am facing a problem with the default functionality of kendo grouping. Kendo grid groups the columns but it doesn't differ records of "USA" with "usa", these ...
I have always seen code like this: (function(){ //code here })(); How does this code work? Which function receives which parameters? (function(factory){ //code here }(function($){ //other ...
I have always seen code like this: (function(){ //code here })(); How does this code work? Which function receives which parameters? (function(factory){ //code here }(function($){ //other ...