从JSON数据到模态窗口HTML

huangapple go评论57阅读模式
英文:

Data from json to modal window html

问题

以下是您要翻译的内容:

I need to display information from json in HTML modal window. I have 12 buttons and when user clicks on it I want to show data of this month from json file.

let myJson;

$(`button`).on(`click`, function() {
  let id_popup = this.attributes[`data-id`].value;
  $.getJSON(`content/js/monthjson.json`, function(months) {
    let month = Object.values(months).filter(function(data) {
      return data.id === id_popup;
    });
    $(`.modal-title`).text(month.georgiamonth);
    $(`.modal-body`).html(month.description);
  });
});

myJson = {
  "months": [{
      "id": 1,
      "georgiamonth": "Jan",
      "description": "description Jan month",
      "suggestmonths": ""
    },
    {
      "id": 2,
      "georgiamonth": "Feb",
      "description": "description Feb month",
      "suggestmonths": ""
    },
    {
      "id": 3,
      "georgiamonth": "Mar",
      "description": "description mar month",
      "suggestmonths": ""
    },
    {
      "id": 4,
      "georgiamonth": "April",
      "description": "",
      "suggestmonths": "description April month"
    },
    {
      "id": 5,
      "georgiamonth": "May",
      "description": "description May month",
      "suggestmonths": ""
    },
    {
      "id": 6,
      "georgiamonth": "June",
      "description": "description June month",
      "suggestmonths": ""
    },
    {
      "id": 7,
      "georgiamonth": "July",
      "description": "description July month",
      "suggestmonths": ""
    },
    {
      "id": 8,
      "georgiamonth": "Aug",
      "description": "description Aug month",
      "suggestmonths": ""
    },
    {
      "id": 9,
      "georgiamonth": "Sept",
      "description": "description Sept month",
      "suggestmonths": ""
    },
    {
      "id": 10,
      "georgiamonth": "Oct",
      "description": "description Oct month",
      "suggestmonths": ""
    },
    {
      "id": 11,
      "georgiamonth": "Nov",
      "description": "description Nov month",
      "suggestmonths": ""
    },
    {
      "id": 12,
      "georgiamonth": "Dec",
      "description": "description Dec month",
      "suggestmonths": ""
    }
  ]
}
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">

<button type="button" class="get-month-data btn btn-outline-danger btn-sm btn-block get-month-id" data-toggle="modal" data-target="#modelId" data-id="1">Show id 1</button>
<button type="button" class="get-month-data btn btn-outline-info btn-sm btn-block" data-toggle="modal" data-target="#modelId" data-id="2">Show id 2</button>
<button type="button" class="get-month-data btn btn-outline-warning btn-sm btn-block" data-toggle="modal" data-target="#modelId" data-id="3">Show id 3</button>
<button type="button" class="get-month-data btn btn-outline-success btn-sm btn-block" data-toggle="modal" data-target="#modelId" data-id="4">Show id 4</button>
<button type="button" class="get-month-data btn btn-outline-danger btn-sm btn-block" data-toggle="modal" data-target="#modelId" data-id="5">Show id 5</button>
<button type="button" class="get-month-data btn btn-outline-info btn-sm btn-block" data-toggle="modal" data-target="#modelId" data-id="6">Show id 6</button>
<button type="button" class="get-month-data btn btn-outline-warning btn-sm btn-block" data-toggle="modal" data-target="#modelId" data-id="7">Show id 7</button>
<button type="button" class="get-month-data btn btn-outline-success btn-sm btn-block" data-toggle="modal" data-target="#modelId" data-id="8">Show id 8</button>
<button type="button" class="get-month-data btn btn-outline-danger btn-sm btn-block" data-toggle="modal" data-target="#modelId" data-id="9">Show id 9</button>
<button type="button" class="get-month-data btn btn-outline-info btn-sm btn-block" data-toggle="modal" data-target="#modelId" data-id="10">Show id 10</button>
<button type="button" class="get-month-data btn btn-outline-warning btn-sm btn-block" data-toggle="modal" data-target="#modelId" data-id="11">Show id 11</button>
<button type="button" id="btn" class="get-month-data btn btn-outline-success btn-sm btn-block" data-toggle="modal" data-id="12" data-target="#modelId">Show id 12</button>

<div class="modal fade" id="modelId" tabindex="-1" role="dialog" aria-labelledby="modelTitleId" aria-hidden="true">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title"> month title here </h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
            <span aria-hidden="true">&times;</span>
        </button>
      </div>

      <div class="modal-body">
        description here
      </div>

      <div class="modal-footer">
        <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
      </div>
    </div>
  </div>
</div>

<script src="https://code.jquery.com/jquery-3.6.3.js" integrity="sha256-nQLuAZGRRcILA+6dMBOvcRh5Pe310sBpanc6+QBmyVM" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZU

<details>
<summary>英文:</summary>

I need to display information from json in HTML modal window. I have 12 buttons and when user clicks on it I want to show data of this month from json file.

&lt;!-- begin snippet: js hide: false console: true babel: false --&gt;

&lt;!-- language: lang-js --&gt;

    let myJson;

    $(`button`).on(`click`, function() {
      let id_popup = this.attributes[`data-id`].value;
      $.getJSON(`content/js/monthjson.json`, function(months) {
        let month = Object.values(months).filter(function(data) {
          return data.id === id_popup;
        });
        $(`.modal-title`).text(month.georgiamonth);
        $(`.modal-body`).html(month.description);
      });
    });

    myJson = {
      &quot;months&quot;: [{
          &quot;id&quot;: 1,
          &quot;georgiamonth&quot;: &quot;Jan&quot;,
          &quot;description&quot;: &quot;description Jan month&quot;,
          &quot;suggestmonths&quot;: &quot;&quot;
        },
        {
          &quot;id&quot;: 2,
          &quot;georgiamonth&quot;: &quot;Feb&quot;,
          &quot;description&quot;: &quot;description Feb month&quot;,
          &quot;suggestmonths&quot;: &quot;&quot;
        },
        {
          &quot;id&quot;: 3,
          &quot;georgiamonth&quot;: &quot;Mar&quot;,
          &quot;description&quot;: &quot;description mar month&quot;,
          &quot;suggestmonths&quot;: &quot;&quot;
        },
        {
          &quot;id&quot;: 4,
          &quot;georgiamonth&quot;: &quot;April&quot;,
          &quot;description&quot;: &quot;&quot;,
          &quot;suggestmonths&quot;: &quot;description April month&quot;
        },
        {
          &quot;id&quot;: 5,
          &quot;georgiamonth&quot;: &quot;May&quot;,
          &quot;description&quot;: &quot;description May month&quot;,
          &quot;suggestmonths&quot;: &quot;&quot;
        },
        {
          &quot;id&quot;: 6,
          &quot;georgiamonth&quot;: &quot;June&quot;,
          &quot;description&quot;: &quot;description June month&quot;,
          &quot;suggestmonths&quot;: &quot;&quot;
        },
        {
          &quot;id&quot;: 7,
          &quot;georgiamonth&quot;: &quot;July&quot;,
          &quot;description&quot;: &quot;description July month&quot;,
          &quot;suggestmonths&quot;: &quot;&quot;
        },
        {
          &quot;id&quot;: 8,
          &quot;georgiamonth&quot;: &quot;Aug&quot;,
          &quot;description&quot;: &quot;description Aug month&quot;,
          &quot;suggestmonths&quot;: &quot;&quot;
        },
        {
          &quot;id&quot;: 9,
          &quot;georgiamonth&quot;: &quot;Sept&quot;,
          &quot;description&quot;: &quot;description Sept month&quot;,
          &quot;suggestmonths&quot;: &quot;&quot;
        },
        {
          &quot;id&quot;: 10,
          &quot;georgiamonth&quot;: &quot;Oct&quot;,
          &quot;description&quot;: &quot;description Oct month&quot;,
          &quot;suggestmonths&quot;: &quot;&quot;
        },
        {
          &quot;id&quot;: 11,
          &quot;georgiamonth&quot;: &quot;Nov&quot;,
          &quot;description&quot;: &quot;description Nov month&quot;,
          &quot;suggestmonths&quot;: &quot;&quot;
        },
        {
          &quot;id&quot;: 12,
          &quot;georgiamonth&quot;: &quot;Dec&quot;,
          &quot;description&quot;: &quot;description Dec month&quot;,
          &quot;suggestmonths&quot;: &quot;&quot;
        }
      ]
    }

&lt;!-- language: lang-html --&gt;

    &lt;link rel=&quot;stylesheet&quot; href=&quot;https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css&quot; integrity=&quot;sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T&quot; crossorigin=&quot;anonymous&quot;&gt;

    &lt;button type=&quot;button&quot; class=&quot;get-month-data btn btn-outline-danger btn-sm btn-block get-month-id&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modelId&quot; data-id=&quot;1&quot;&gt;Show id 1&lt;/button&gt;
    &lt;button type=&quot;button&quot; class=&quot;get-month-data btn btn-outline-info btn-sm btn-block&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modelId&quot; data-id=&quot;2&quot;&gt;Show id 2&lt;/button&gt;
    &lt;button type=&quot;button&quot; class=&quot;get-month-data btn btn-outline-warning btn-sm btn-block&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modelId&quot; data-id=&quot;3&quot;&gt;Show id 3&lt;/button&gt;
    &lt;button type=&quot;button&quot; class=&quot;get-month-data btn btn-outline-success btn-sm btn-block&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modelId&quot; data-id=&quot;4&quot;&gt;Show id 4&lt;/button&gt;
    &lt;button type=&quot;button&quot; class=&quot;get-month-data btn btn-outline-danger btn-sm btn-block&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modelId&quot; data-id=&quot;5&quot;&gt;Show id 5&lt;/button&gt;
    &lt;button type=&quot;button&quot; class=&quot;get-month-data btn btn-outline-info btn-sm btn-block&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modelId&quot; data-id=&quot;6&quot;&gt;Show id 6&lt;/button&gt;
    &lt;button type=&quot;button&quot; class=&quot;get-month-data btn btn-outline-warning btn-sm btn-block&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modelId&quot; data-id=&quot;7&quot;&gt;Show id 7&lt;/button&gt;
    &lt;button type=&quot;button&quot; class=&quot;get-month-data btn btn-outline-success btn-sm btn-block&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modelId&quot; data-id=&quot;8&quot;&gt;Show id 8&lt;/button&gt;
    &lt;button type=&quot;button&quot; class=&quot;get-month-data btn btn-outline-danger btn-sm btn-block&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modelId&quot; data-id=&quot;9&quot;&gt;Show id 9&lt;/button&gt;
    &lt;button type=&quot;button&quot; class=&quot;get-month-data btn btn-outline-info btn-sm btn-block&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modelId&quot; data-id=&quot;10&quot;&gt;Show id 10&lt;/button&gt;
    &lt;button type=&quot;button&quot; class=&quot;get-month-data btn btn-outline-warning btn-sm btn-block&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modelId&quot; data-id=&quot;11&quot;&gt;Show id 11&lt;/button&gt;
    &lt;button type=&quot;button&quot; id=&quot;btn&quot; class=&quot;get-month-data btn btn-outline-success btn-sm btn-block&quot; data-toggle=&quot;modal&quot; data-id=&quot;12&quot; data-target=&quot;#modelId&quot;&gt;Show id 12&lt;/button&gt;

    &lt;div class=&quot;modal fade&quot; id=&quot;modelId&quot; tabindex=&quot;-1&quot; role=&quot;dialog&quot; aria-labelledby=&quot;modelTitleId&quot; aria-hidden=&quot;true&quot;&gt;
      &lt;div class=&quot;modal-dialog&quot; role=&quot;document&quot;&gt;
        &lt;div class=&quot;modal-content&quot;&gt;
          &lt;div class=&quot;modal-header&quot;&gt;
            &lt;h5 class=&quot;modal-title&quot;&gt; month title here &lt;/h5&gt;
            &lt;button type=&quot;button&quot; class=&quot;close&quot; data-dismiss=&quot;modal&quot; aria-label=&quot;Close&quot;&gt;
                &lt;span aria-hidden=&quot;true&quot;&gt;&amp;times;&lt;/span&gt;
            &lt;/button&gt;
          &lt;/div&gt;

          &lt;div class=&quot;modal-body&quot;&gt;
            description here
          &lt;/div&gt;

          &lt;div class=&quot;modal-footer&quot;&gt;
            &lt;button type=&quot;button&quot; class=&quot;btn btn-secondary&quot; data-dismiss=&quot;modal&quot;&gt;Close&lt;/button&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;

    &lt;script src=&quot;https://code.jquery.com/jquery-3.6.3.js&quot; integrity=&quot;sha256-nQLuAZGRRcILA+6dMBOvcRh5Pe310sBpanc6+QBmyVM=&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;
    &lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js&quot; integrity=&quot;sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;
    &lt;script src=&quot;https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js&quot; integrity=&quot;sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;

&lt;!-- end snippet --&gt;



</details>


# 答案1
**得分**: 0

以下是您要翻译的内容:

"First, you seem to be using backticks instead of apostrophes in your jQuery selectors and elsewhere. That&#39;s not standard, and while it may work I recommend against it if only for reasons of convention. I&#39;ve made the conversion here.

Then, rather than adding a click handler we&#39;ll just use Bootstrap&#39;s modal show event, getting the ID from the `relatedTarget` on the event.

Finally, we&#39;ll use the `find()` method to get the corresponding data object from the array.

Bonus tip: Get your data just once on page load instead of every time a button is clicked. That is, if you don&#39;t expect the data to change frequently."

请注意代码部分没有被翻译只翻译了文本内容

<details>
<summary>英文:</summary>

First, you seem to be using backticks instead of apostrophes in your jQuery selectors and elsewhere. That&#39;s not standard, and while it may work I recommend against it if only for reasons of convention. I&#39;ve made the conversion here.

Then, rather than adding a click handler we&#39;ll just use Bootstrap&#39;s modal show event, getting the ID from the `relatedTarget` on the event. 

Finally, we&#39;ll use the `find()` method to get the corresponding data object from the array. 

Bonus tip: Get your data just once on page load instead of every time a button is clicked. That is, if you don&#39;t expect the data to change frequently. 

&lt;!-- begin snippet: js hide: false console: true babel: false --&gt;

&lt;!-- language: lang-js --&gt;

    let myJson;

    $(&#39;#modelId&#39;).on(&#39;show.bs.modal&#39;, function(event) {
      const id_popup = event.relatedTarget.getAttribute(&#39;data-id&#39;);

      // $.getJSON(&#39;content/js/monthjson.json&#39;, function(months) {
        const month = myJson.months.find(el =&gt; el.id == id_popup);

        $(&#39;.modal-title&#39;).text(month.georgiamonth);
        $(&#39;.modal-body&#39;).html(month.description);
      // });
    });

    myJson = {
      &quot;months&quot;: [{
          &quot;id&quot;: 1,
          &quot;georgiamonth&quot;: &quot;Jan&quot;,
          &quot;description&quot;: &quot;description Jan month&quot;,
          &quot;suggestmonths&quot;: &quot;&quot;
        },
        {
          &quot;id&quot;: 2,
          &quot;georgiamonth&quot;: &quot;Feb&quot;,
          &quot;description&quot;: &quot;description Feb month&quot;,
          &quot;suggestmonths&quot;: &quot;&quot;
        },
        {
          &quot;id&quot;: 3,
          &quot;georgiamonth&quot;: &quot;Mar&quot;,
          &quot;description&quot;: &quot;description mar month&quot;,
          &quot;suggestmonths&quot;: &quot;&quot;
        },
        {
          &quot;id&quot;: 4,
          &quot;georgiamonth&quot;: &quot;April&quot;,
          &quot;description&quot;: &quot;&quot;,
          &quot;suggestmonths&quot;: &quot;description April month&quot;
        },
        {
          &quot;id&quot;: 5,
          &quot;georgiamonth&quot;: &quot;May&quot;,
          &quot;description&quot;: &quot;description May month&quot;,
          &quot;suggestmonths&quot;: &quot;&quot;
        },
        {
          &quot;id&quot;: 6,
          &quot;georgiamonth&quot;: &quot;June&quot;,
          &quot;description&quot;: &quot;description June month&quot;,
          &quot;suggestmonths&quot;: &quot;&quot;
        },
        {
          &quot;id&quot;: 7,
          &quot;georgiamonth&quot;: &quot;July&quot;,
          &quot;description&quot;: &quot;description July month&quot;,
          &quot;suggestmonths&quot;: &quot;&quot;
        },
        {
          &quot;id&quot;: 8,
          &quot;georgiamonth&quot;: &quot;Aug&quot;,
          &quot;description&quot;: &quot;description Aug month&quot;,
          &quot;suggestmonths&quot;: &quot;&quot;
        },
        {
          &quot;id&quot;: 9,
          &quot;georgiamonth&quot;: &quot;Sept&quot;,
          &quot;description&quot;: &quot;description Sept month&quot;,
          &quot;suggestmonths&quot;: &quot;&quot;
        },
        {
          &quot;id&quot;: 10,
          &quot;georgiamonth&quot;: &quot;Oct&quot;,
          &quot;description&quot;: &quot;description Oct month&quot;,
          &quot;suggestmonths&quot;: &quot;&quot;
        },
        {
          &quot;id&quot;: 11,
          &quot;georgiamonth&quot;: &quot;Nov&quot;,
          &quot;description&quot;: &quot;description Nov month&quot;,
          &quot;suggestmonths&quot;: &quot;&quot;
        },
        {
          &quot;id&quot;: 12,
          &quot;georgiamonth&quot;: &quot;Dec&quot;,
          &quot;description&quot;: &quot;description Dec month&quot;,
          &quot;suggestmonths&quot;: &quot;&quot;
        }
      ]
    };

&lt;!-- language: lang-html --&gt;

    &lt;link rel=&quot;stylesheet&quot; href=&quot;https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css&quot; integrity=&quot;sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T&quot; crossorigin=&quot;anonymous&quot;&gt;

    &lt;button type=&quot;button&quot; class=&quot;get-month-data btn btn-outline-danger btn-sm btn-block get-month-id&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modelId&quot; data-id=&quot;1&quot;&gt;Show id 1&lt;/button&gt;
    &lt;button type=&quot;button&quot; class=&quot;get-month-data btn btn-outline-info btn-sm btn-block&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modelId&quot; data-id=&quot;2&quot;&gt;Show id 2&lt;/button&gt;
    &lt;button type=&quot;button&quot; class=&quot;get-month-data btn btn-outline-warning btn-sm btn-block&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modelId&quot; data-id=&quot;3&quot;&gt;Show id 3&lt;/button&gt;
    &lt;button type=&quot;button&quot; class=&quot;get-month-data btn btn-outline-success btn-sm btn-block&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modelId&quot; data-id=&quot;4&quot;&gt;Show id 4&lt;/button&gt;
    &lt;button type=&quot;button&quot; class=&quot;get-month-data btn btn-outline-danger btn-sm btn-block&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modelId&quot; data-id=&quot;5&quot;&gt;Show id 5&lt;/button&gt;
    &lt;button type=&quot;button&quot; class=&quot;get-month-data btn btn-outline-info btn-sm btn-block&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modelId&quot; data-id=&quot;6&quot;&gt;Show id 6&lt;/button&gt;
    &lt;button type=&quot;button&quot; class=&quot;get-month-data btn btn-outline-warning btn-sm btn-block&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modelId&quot; data-id=&quot;7&quot;&gt;Show id 7&lt;/button&gt;
    &lt;button type=&quot;button&quot; class=&quot;get-month-data btn btn-outline-success btn-sm btn-block&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modelId&quot; data-id=&quot;8&quot;&gt;Show id 8&lt;/button&gt;
    &lt;button type=&quot;button&quot; class=&quot;get-month-data btn btn-outline-danger btn-sm btn-block&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modelId&quot; data-id=&quot;9&quot;&gt;Show id 9&lt;/button&gt;
    &lt;button type=&quot;button&quot; class=&quot;get-month-data btn btn-outline-info btn-sm btn-block&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modelId&quot; data-id=&quot;10&quot;&gt;Show id 10&lt;/button&gt;
    &lt;button type=&quot;button&quot; class=&quot;get-month-data btn btn-outline-warning btn-sm btn-block&quot; data-toggle=&quot;modal&quot; data-target=&quot;#modelId&quot; data-id=&quot;11&quot;&gt;Show id 11&lt;/button&gt;
    &lt;button type=&quot;button&quot; id=&quot;btn&quot; class=&quot;get-month-data btn btn-outline-success btn-sm btn-block&quot; data-toggle=&quot;modal&quot; data-id=&quot;12&quot; data-target=&quot;#modelId&quot;&gt;Show id 12&lt;/button&gt;

    &lt;div class=&quot;modal fade&quot; id=&quot;modelId&quot; tabindex=&quot;-1&quot; role=&quot;dialog&quot; aria-labelledby=&quot;modelTitleId&quot; aria-hidden=&quot;true&quot;&gt;
      &lt;div class=&quot;modal-dialog&quot; role=&quot;document&quot;&gt;
        &lt;div class=&quot;modal-content&quot;&gt;
          &lt;div class=&quot;modal-header&quot;&gt;
            &lt;h5 class=&quot;modal-title&quot;&gt; month title here &lt;/h5&gt;
            
            &lt;button type=&quot;button&quot; class=&quot;close&quot; data-dismiss=&quot;modal&quot; aria-label=&quot;Close&quot;&gt;
                &lt;span aria-hidden=&quot;true&quot;&gt;&amp;times;&lt;/span&gt;
            &lt;/button&gt;
          &lt;/div&gt;

          &lt;div class=&quot;modal-body&quot;&gt;
            description here
          &lt;/div&gt;

          &lt;div class=&quot;modal-footer&quot;&gt;
            &lt;button type=&quot;button&quot; class=&quot;btn btn-secondary&quot; data-dismiss=&quot;modal&quot;&gt;Close&lt;/button&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;

    &lt;script src=&quot;https://code.jquery.com/jquery-3.6.3.js&quot; integrity=&quot;sha256-nQLuAZGRRcILA+6dMBOvcRh5Pe310sBpanc6+QBmyVM=&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;
    &lt;script src=&quot;https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js&quot; integrity=&quot;sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;
    &lt;script src=&quot;https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js&quot; integrity=&quot;sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;

&lt;!-- end snippet --&gt;



</details>



huangapple
  • 本文由 发表于 2023年2月14日 02:05:34
  • 转载请务必保留本文链接:https://go.coder-hub.com/75439655.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定