Level 3
@gagas17 Try like this In your Laravel blade file.
<script>
var decodedText = "{{ $decodedText }}";
window.location.href = "/newPage/" + encodeURIComponent(decodedText);
</script>
1 like
So i have a JS variable $decodedText and want to redirect to a page /newpage/$decodedText, i found window.location.href in JS but not succesfully done it with the $decodedText, code that failed below
window.location.href = '{{url("/newPage/$decodedText")}}'
@gagas17 Try like this In your Laravel blade file.
<script>
var decodedText = "{{ $decodedText }}";
window.location.href = "/newPage/" + encodeURIComponent(decodedText);
</script>
Please or to participate in this conversation.