Home > Backend Development > PHP Tutorial > jquery变量赋值有关问题

jquery变量赋值有关问题

WBOY
Release: 2016-06-13 12:13:00
Original
934 people have browsed it

jquery变量赋值问题
jquery变量赋值问题
$(function() {
        $('#dosearch').click(function() {
            var id = $('#search').val();
            window.location.href = '{{ URL::route('admin.show',array('id'=>+id))}}';
        });
    });
jquery获取到了值,赋值到变量id里,怎样把这个变量放到array('id'=>+id)这个地方呢?+id不对
------解决思路----------------------
看看 {{ URL::route('admin.show',array('id'=>+id))}} 在 html 中变成了什么
------解决思路----------------------
这个url 是你php中路由的写法吧。
------解决思路----------------------
有一点 可以 肯定  你的 写法 就是错的  外面请用双引号

<br />”{{ URL::route('admin.show',array('id'=>+id))}}“<br />
Copy after login


其次  这貌似是php里调用某个方法,不知道 你为什么写到js里了!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template