html - Is it possible to add mailto link inside custom bootbox? -


i wondering if possible add <a href="mailto:someone@yoursite.com">email us</a> custom bootbox? user have option of clicking email link. i'm using:

function dberror() { var box = bootbox.dialog({     message: "there problem when trying connect database. please try again or contact "'<a href="mailto:someone@yoursite.com">email us</a>'" resolve issue if persists.",     title: "database error" }); box.find('.modal-title').css({ 'color' : 'red' }); }; 

this works ok, if remove <a href="mailto:someone@yoursite.com">email us</a>. or suggestions appreciated. thanks!

your message string causing error - here:

"...please try again or contact "' 

when close double quotes " " javascript reads end of string , expects ; or + otherwise throw error.

minor fix :)

var = '<a href="mailto:someone@yoursite.com">email us</a>';  var message = "there problem when trying connect database." +     " please try again or contact " + + " resolve issue if persists."   var box = bootbox.dialog({     message: message,     title: "database error" }); 

snippet:

var = '<a href="mailto:someone@yoursite.com">email us</a>';      var message = "there problem when trying connect database." +      " please try again or contact " + + " resolve issue if persists.";          var box = bootbox.dialog({      message: message,      title: "database error"  });
<script src="https://code.jquery.com/jquery-2.1.3.min.js"></script>  <link href="http://bootboxjs.com/css/main.css" rel="stylesheet"/>  <link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" rel="stylesheet"/>  <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"></script>  <script src="http://bootboxjs.com/bootbox.js"></script>    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>  <div id="mymodal" class="modal fade">      <div class="modal-dialog">          <div class="modal-content">              <!-- dialog body -->              <div class="modal-body">                  <button type="button" class="close" data-dismiss="modal">&times;</button>send emails to:</div>              <!-- dialog buttons -->              <div class="modal-footer">                  <button type="button" class="btn btn-primary">ok</button>              </div>          </div>      </div>  </div>


Comments

Popular posts from this blog

shopping cart - Page redirect not working PHP -

php - How to modify a menu to show sub-menus -

python - Installing PyDev in eclipse is failed -