0

I am trying to show a bootstrap modal with dynamic content so one of the values being passed to the modal is the HTML to be shown in it.

My problem is that in the HTML content being passed, I have a script tag that returns an object on execution, so when the modal is shown the script tag is not being executed. Is there any way I can execute the script tag before the modal is shown so that I get the object in he HTML before I pass it to the modal?

2
  • Show what have you done Commented Sep 4, 2016 at 14:55
  • You can hook to the show.bs.modal or shown.bs.modal event and get the HTML. See getbootstrap.com/javascript/#modals-events for more details Commented Sep 4, 2016 at 14:55

1 Answer 1

2

Hello you can use the below events :

 //The dropdown is about to be shown. $("#selectGroup .dropdown").on('show.bs.dropdown', function(){ }); //The dropdown is now fully shown. $("#selectGroup .dropdown").on('shown.bs.dropdown', function(){ //your code here }); 

Of course you change the DOM elements to fit yours.Hope helps good luck.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.