Skip to content

Instantly share code, notes, and snippets.

@wotchin
Created January 31, 2018 11:20
Show Gist options
  • Save wotchin/5da42fe0ccb29d8abbd5ffbde886d84f to your computer and use it in GitHub Desktop.
Save wotchin/5da42fe0ccb29d8abbd5ffbde886d84f to your computer and use it in GitHub Desktop.
Modal-Alert replace alert() function.
function modalRender(text) {
var modal = $("<div class=\"modal fade\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"alertModal\" aria-hidden=\"true\"></div>").append(
$("<div class=\"modal-dialog\"></div>").append(
$("<div class=\"modal-content\"></div>").append(
$("<div class=\"modal-body\">"+text+"</div>")
)
)
);
modal.modal();
}
//ps.
//dependence jQuery.
@wotchin
Copy link
Author

wotchin commented Jan 31, 2018

rely on jquery and bootstrap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment