一般:
1.在html中写js可用
1). url: "{:url('index/Goods/getGoods')}"
2). url: "getGoods"
2.引入的js文件中 只能用 2
特别:
1.form表单 产生链接:http://plat.domall.cc/index/goods/index?sign=chaoshi&search=空调
<form action="{:url('index/goods/index')}" method="get" class="form-search ">
2.a标签,产生链接:http://plat.domall.cc/index/goods/index/sign/chaoshi/search/空调
<a href="{:url('index/goods/index', array('sign'=>$webpage->sign, 'search'=> $search))}">全部结果</a>
特别注意2产生的链接,当在2中产生的链接再进行操作时,在html中js的url无影响,引入的js文件中1)和2)都会生成错误链接:
http://plat.domall.cc/index/goods/index/sign/chaoshi/search/url: "{:url('index/Goods/getGoods')}"
http://plat.domall.cc/index/goods/index/sign/chaoshi/search/getGoods
暂时还没有找到解决办法,只能将引入js文件中用到url的代码移到html中,(⊙﹏⊙)