Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
321 views
in Technique[技术] by (71.8m points)

django - Why Button is not showing in javascript

In my project, button not showing in frontend. what can i do for showing the button???

function updatePopover(product_cart){
  console.log('we are in updatePopover');
  var popStr = "";
  popStr = popStr + "<h5>cart for your items</h5> <div class='mx-2 my-2'>";
  var i =1;
  for (var item in product_cart){
    popStr = popStr + "<b>" + i + "</b>. ";
    popStr = popStr + document.getElementById('name' + item).innerHTML.slice(0, 25) + "... Qty: " + product_cart[item] + '<br>';
    i = i+1;
  }
  popStr = popStr + "</div> <a href='/checkout' class='btn_1' id='checkout'>CheckOut</a> **<button 
  class='btn_1' onclick='clearCart()'>Clear Cart</button><button class='btn btn-primary'></button>** "
  document.getElementById("popcarts").setAttribute('data-content', popStr);
  $('#popcarts').popover('show');
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Accually i solved the problem. I faced the problem becouse of version of bootstrap. i used bootsrap 4.3 to make the project, but when i add popover feature, i take bootstrap v5 popover. Thats way, in the popover button is not showing.

Solution : Use same version of bootstrap for popover.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...