<p dir="auto">I'm using bootstrap v2.3.0, when I am using data-backdrop="static" in html and using javascript modal('hide') to hide the modal, the javascript occured error:<br>
Uncaught TypeError: Cannot call method 'remove' of undefined bootstrap.min.js:6</p>
<p dir="auto">Below is my solution:<br>
change:<br>
removeBackdrop: function () {<br>
this.$backdrop.remove()<br>
this.$backdrop = null<br>
}<br>
to:<br>
removeBackdrop: function () {<br>
if(this.$backdrop){<br>
this.$backdrop.remove()<br>
this.$backdrop = null<br>
}<br>
}</p>
<p dir="auto">Thanks guys.</p>
<p dir="auto">With options { backdrop: false }, this.$backdrop.remove() is still being called which results in an exception as this.$backdrop is null.</p>
<code class="notranslate">
    hideModal: function () {
        var that = this
        this.$element.hide()
        this.backdrop(function () {
          that.removeBackdrop()
          that.$element.trigger('hidden')
        })
      }
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="removeBackdrop: function () {
        this.$backdrop.remove()
        this.$backdrop = null
  }"><pre class="notranslate"><code class="notranslate">removeBackdrop: function () {
        this.$backdrop.remove()
        this.$backdrop = null
  }
</code></pre></div>
</code>