
Untitled
By: a guest on
Jun 26th, 2012 | syntax:
None | size: 0.66 KB | hits: 9 | expires: Never
render a partial after a successful ajax call?
$.ajax({
url: "/update_fb_user?fb_uid=" + FB.getSession().uid,
dataType: 'json',
success: function(data){
if(data.user != "none"){
// here is where i need to render this partial
}else{
window.location.href = '/signup';
}
}
<div id="fb_iframe">
<% unless current_user.not_using_facebook? %>
<%= render :partial => 'fb_iframe' %>
<% end %>
</div>
$.ajax({
url: "/update_fb_user?fb_uid=" + FB.getSession().uid,
dataType: 'json',
success: function(data){
if(data.user != "none"){
window.location.reload();
}else{
window.location.href = '/signup';
}
}
});