I'm Working with Laravel and jquery. I have e-commerce and I have a list of my products some of them are on my web site and some of them Don't I need to redirect the ones that are inside my web and open a new tab the others. for example:
<a href="www.MYWEB.COM" > MY PRODUCTS</a>
<a href="https://www.w3schools.com" target="_blank"> Producs from other website </a>
is it possible? So far I have this. I really need help.
<div class="dropdown-menu dropdown-menu-right">
<div class="header-items">My Products<span class="count-items ml-1"></span></div>
@foreach ($notifications as $item)
<a href="" class="idNote" data-note="" style="color: #000000;" data-redirect="">
<div id="note-" class="item " >
<p class="mb-0 font-medium"></p>
<p class="mb-0"></p>
<span class="point-not-read"></span>
</div>
</a>
@endforeach
</div>
my jquery
<script>
$('.idNote').click(function(e){
e.preventDefault();
var noteId = $(this).attr('data-note');
var redirecTwo = $(this).attr('data-redirect');
console.log(noteId);
$.ajax({
url : "",
type : "POST",
data : {
jsNoteId : noteId
},
beforeSend : function(){
$('#note-'+noteId).removeClass('not-read');
//window.location = redirecTwo;
window.open(redirecTwo, '_blank');
},
success : function(r){
console.log(r);
}
});
});
</script>
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2rtBezM
via IFTTT
Aucun commentaire:
Enregistrer un commentaire