So i try to make popup with http://t4t5.github.io/sweetalert/ in html i make:
<button class='btn btn-xs btn-danger delete-button'
onclick="deleteDomain('test {{$domain->domain_name}}?',{{$domain->id}},{{$domain->second}})">
DELETE
</button>
and in js: ``` function deleteDomain(msg,networkId,domainId) { swal({ title: "Are you sure??", text: msg, type: "warning", showCancelButton: true, confirmButtonColor: "#
confirmButtonText: "Del!!",
cancelButtonText: "No!!",
closeOnConfirm: true,
closeOnCancel: true
},
function (isConfirm) {
if (isConfirm) {
document.location.href="{!! route('domains.destroy',[networkId,domainId]) !!}";
}
});
};
and i have two errors one is in line
document.location.href="{!! route('domains.destroy',[networkId,domainId]) !!}";
Use of undefined constant networkId - assumed 'networkId' and second when i try to pass data in:
onclick="deleteDomain('test {{$domain->domain_name}}?',{{$domain->id}},{{$domain->second}})">
i have errors expression exception beetwen , and {{$domain->id}} what should i do?
What You can do is to define a hidden field like this:
<input type="hidden" id='myURL' value="{{url('my/url')}}">
use the '#id' to access the url.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community