zurb foundation - How to show/not show a Reveal depending on data being returned from an AJAX source -


i have convert system runs ajax script , displays alert if returned data length greater 0 ie message returned. runs on form load, , periodically thereafter via timer. i'm trying impliment using foundation 5.

when add reveal page, displays whether there's data or not. if use success callback function check length of returned data, how stop reveal displaying if length zero? i've tried following code:

    $('#messagemodal').foundation('reveal', 'open', {         url: 'check_message_ajax.php',         success: function(data) {             if(data.length == 0) {                 return false;  // tried "return;" ,  "stop;"             }         },         error: function() {             alert('failed loading modal');         }     }); 

any pointers appreciated.


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -