i am working on a coupon website and i need to open popup modal on next page whenever i click on the coupon
i tried alot but nothing works iam working on laravel 6 here's the jscript code $('#newpage').click(function(){ window.location.assign('<?php echo $loc ?>'); window.open('{{route('stores', ['brand_id' => $myuser->Url_Title])}}'); here's the button code <button id= "newpage" class="btn" data-toggle="modal" data-mytitle = "<?php echo $myuser->Title?>" data-target="#showdata" data-mycode = "<?php echo $myuser->Discount_Code ?>" style="color:white;background-color: #348700;border-radius: 3px; padding: 10px 10px; width: 100%"> <?php if($myuser->Type == "Code") {?> Show Code <?php } else { ?> Get Offer <?php } ?> </button> and here's the modal code <!--POPUP MODAL --> <?php //$users = DB::table('brands')->get(); $users = DB::table('coupons') ->join('brands', 'brands.Name', '=', 'coupons.Brand') ->select('coupons.*','brands.*') ->Limit(1) ->where('coupons.Url_Title','=',$brand_id) ->first();{ ?> <div class="modal fade p-5" id="showdata" tabindex="-1" role="dialog"> <div class="modal-dialog" role="document"> <div class="modal-content"> <button style="margin-left: 90%;" type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> <div class="modal-body"> <img style="margin:20px 33%;" src="<?php echo asset("assets/brands/$users->Image")?>"></img> <h5 id="Title" style="color: black; margin-left:9%; margin-top:15px;">