Level 46
Put the url in the data attribute and append the id to it. Javascript has no idea what those blade delimiters are or what the route function is.
hello guys i have one javascript here is my code
$('.view').on('click', function() {
var id = $(this).attr("data-id");
var $iframe=$('<object data="{{ route('browserview', +id) }}" width="100%" height="600px"></object>');
$("#newname").append( $iframe);
});
how i can value value of id into something like this {{ route('browserview', +id) }} +id not working
i solve my issue by this here is solution
var url= "{{ url('browserview') }}"+"/"+id;
var $iframe=$('<object data="'+url+'" width="100%" height="600px"></object>');
$("#newname").append( $iframe);
Please or to participate in this conversation.