Skip to main content

Magento 2.2.2 bootstrap.min.js:7 Uncaught TypeError: f[b] is not a function

I am Using Magento 2.2.2. I have inserted this code in the Block i.e Content>Block when wei click on the Ask an Expert image , The Modal popup should appear. But currently its not showing popup, the error is show.

<div class="call-us">
    <div class="call-us-content">
        <a id="click-me" href="#"><img src="{{media url="wysiwyg/icon/askanExpert.png"}}" alt="Ask an Expert" style="height: 50px; position: relative;" /></a>
    </div>

</div>
<div id="popup-mpdal"  style="display:none;">
<br>
<img src="{{media url="wysiwyg/icon/IconAskExpert.png"}}" alt="Ask an Expert" />
<br/>
<p style="font-size: 17px;">Mon-Sat (10 AM to 6 PM)</p>
<p style="font-size: 18px;">Get Free Consultation From Our Certified Expert</p><br>
<p style="color: #2B375C;font-size: 35px;"><em class="fa fa-phone" style=" padding-right: 10px;    position: relative;
    top: 2px;"></em><a style="    color: #76c705;" href="tel:0120-4673988">0120-4673988</a></p>
</div>
<script type="text/javascript" xml="space">
    require(
        [
     'jquery',
            'Magento_Ui/js/modal/modal',
            '!domReady'
        ],
        function(
            $,
            modal
        ) {
            var options = {
                type: 'popup',
                responsive: true,
                innerScroll: true,
               modalLeftMargin: 45,
                title: 'Consult our Expert',
  modalClass: 'ask-our-expert',
 clickableOverlay: true,
  buttons: [{
                    text: $.mage.__('Continue'),
                    class: '',
                    click: function () {
                        this.closeModal();
                    }
                }]
              
            };

      
 var popup = modal(options, $('#popup-mpdal'));

            $("#click-me").on('click',function(){ 

             $("#popup-mpdal").modal("openModal");
           
            });

        }
    );

</script>