Emma Emma - 1 year ago 34
Perl Question

Hide model in js using perl

I've some confusion regarding using modals in js in Perl, In my case i have a view File having button

<button type="button" id="helloWorld" ></button>

and an array is requested when user clicks on
i-e JS is used to call array from controller,

var URL = encodeURI("/helloWorld");
$('#modal').load(URL, function(result){

so that returned data is used in load modal, but now i want to hide the modal and show an error message if the returned array is NULL,
how is it possible to load data only if array is not NULL
can any one give me some tips to solve the above issue


you can do like the following to check the result value if its not NULL then show the modal else do something else.

if (result) {
}else { # do someting if required }