0

I am seeing a jQuery error in the console when the page loads. i have tried this link, but the issue has not been resolved

enter image description here

i do know where it comes from.when i refresh the page the issue is resolved.

anyone have idea about this?

2
  • This is a classic require js issue. To debug it though, could you post the code you are using that is kicking an error? if you have already added in a require to the code, it might just be a syntax error.
    – circlesix
    Commented Mar 29, 2018 at 21:50
  • @circlesix i have added my script.could you please tell me where i have made an error.
    – chris
    Commented Apr 2, 2018 at 4:22

1 Answer 1

0

This is the code which i am using in phtml file

<script>  
  require(
        ['jquery','Magento_Ui/js/modal/modal','jquery/ui','Company_Custom/js/jquery.cookie'],
        function($, modal) {
            var options = {
                type: 'popup',
                responsive: true,
                innerScroll: true,
                modalClass: 'store_cookie_popup'
            };
            if(!$.cookie("warehouse_id")){
                var popup = modal(options, $('#popup_content'));
                $("#popup_content").modal("openModal");
            }
            $('.store_cookie_popup .action-close').click(function(event) {
                $('#ajaxloader').css('display','none');
                $('.loader-overlay').css('display','none');
                $('.loader-overlay.active').css('display','none');
                $('.page-wrapper').css('opacity','1');
                $('.detect').trigger('click');
            });
            $('.store_cookie_popup .nearmarker_store').on('click',function(){
                var id = $(this).attr('key');
                $.cookie("warehouse_id", id);
                window.location.href = "http://192.168.1.157/module/";
            });
        }
    );
</script>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.