1

I'd like to open a modal with bootstrap 3 data-toggle="ajaxmodal". The link is appended to a div, the ajaxModal however is not working.

$('<div/>').text(message.text).prepend($('<em/>').html('Opponent: '+ opponentName + ',' + ' ' + 'Game amount: ' + message.amount + ' ' + 'tokens,' + ' ' + 'Game: ' + message.game + ' &nbsp; ' + '&nbsp; ' + '&nbsp; ' + '<a href="console/challengeView.php?id=' + message.gameID + '" id="viewButton"  class="btn btn-s-s btn-danger" onClick="return false;" data-toggle="ajaxModal">View</a>')).appendTo($('#pendingChallenges'));

$('#pendingChallenges')[0].scrollTop = $('#pendingChallenges')[0].scrollHeight;

I also tried

$("#viewButton").click(function () {
    $(this).attr('toggle')=='ajaxModal';
});
Khawer Zeshan
  • 9,470
  • 6
  • 40
  • 63
user3052997
  • 91
  • 10
  • Have you tried it without the `onClick="return false;"` ? – ilias Jan 04 '14 at 00:24
  • This one might be of help: [ajax content in bootstrap modal](http://stackoverflow.com/questions/14971766/load-content-with-ajax-in-bootstrap-modal) – ilias Jan 04 '14 at 16:16

0 Answers0