Post request to JSON won't fire again?
I'm having a bit of trouble understanding why my JSON won't return to me twice in a row.
I have a button that I press, it returns a list of links to me and enters them into a box. When I hit 'close' it removes all html from that box to 'hide' it and in theory when I click on the button again it should give me the list of links again (which if there's new links it should update).
The file I'm calling is php and returns a JSON string that I parse further in the function.
-
function post_link(url, to_obj){
$.post(url, {}, function(data){
if (data.success == 'true'){
var str_html = "<ul>";
$.each(data.links, function(i, val){
str_html += "<li>"+val+"</li>";
});
str_html += "</ul>";
str_html += "<a href='' onclick='closeTab();return false;'>close</a>";
to_obj.html(str_html);
}
return;
}, "json");
}
Is there a reason that this wouldn't post a second time? Is it in cache? If it is, how can I get it back?
Thanks