简体   繁体   中英

How can i insert Multiple html into the modal through Javascript

Actually My question is after onclick My Modal is appear and i can insert multiple things into the Modal and i can do this through

(.html("abc");)

But the above syntax is insert only one string if i append multiple String it's shows error Here is my Code:

    echo "<script>
   function myFunction(order){
   $('.modal-body').html(order.order_id);
   $('#myModal').modal({backdrop: false}); /#myModal is the body of the Modal 
       }
   </script>"; 

Now i find out the soloution we can use this:

     $('.modal-body').html('<b>Order Number</b>: '+order.order_id +
 '<br>'+'<b>Order Date:</b>' + ' ' +order.created_date+ '<br>'+'<b>Table Number:</b>' + ' ' +order.uid + '<br>'+'<b>Status:</b> ' + ' ' +order.status+ '<br>'+'<b>Title:</b>' + ' ' +order.title + '<br>'+'<b>Quantity:</b>' + ' ' +order.quantity+ '<br>'+'<b>Personalization:</b>' + ' ' +order.personalization);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM