jquery variable Assignment problem
jquery variable Assignment problem
$ (function () {
$ (' #dosearch '). Click (function () {
var id = $ (' #search '). Val ();
Window.location.href = ' {url::route (' admin.show ', array (' ID ' =>+id)}} ';
});
});
jquery Gets the value, the assignment to the variable ID, how to put the variable in the place of the array (' ID ' =>+id)? +id wrong.
------to solve the idea----------------------
See {{url::route (' admin.show ', array (' ID ' =>+id)}}} in HTML what's become
------to solve the idea----------------------
This URL is your PHP in the middle of the wording of it.
------to solve the idea----------------------
One thing's for sure, you're wrong. Use double quotation marks outside.
"{{Url::route (' admin.show ', array (' ID ' =>+id)}}"
Second, it seems that PHP calls a method, do not know why you write to JS!