您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

$.post 错误怎么回事?

2025/12/28 9:58:09发布14次查看
$.post 错误怎么回事?
$(function(){ $('#bn').click(function() { var r = []; $('.xh').each(function(i, t) { r.push($(this).html()); }); alert(r); $.post(yidong.php,{xh :r}); });});[code=php] 编号 名 称 种 类 类 别 图 片 简 介 图 示 介 绍 公 司 开 始 结 束 地 址 休 息 网 址 停 止 操 作 排 序
{foreach from=$shop item=i} {$i[id]} {$i[name]} {$i[varietyid]} {$i[classifyid]} {$i[list_pic]} {$i[introduction]} {$i[show_pic]} {$i[product_introduction]} {$i[company]} {$i[business_start]} {$i[business_end]} {$i[address]} {$i[rest_flag]} {$i[web]} {$i[del_flag]} 修改 删除 上移 下移 置顶
{/foreach}

[/code]
错误代码:
fatal error: uncaught --> smarty compiler: syntax error in template c:\wamp\www\xcx\user\templates\shop.tpl on line 154 $.post(yidong.php,{xh :r}); - unexpected  :, expected one of: }
回复讨论(解决方案) smarty 模版中有错误,导致模版编译失败。
检查下模版中代码内容。
smarty 模版中有错误,导致模版编译失败。
检查下模版中代码内容。
发的代码就是模板里的     $.post(yidong.php,{xh :r});这句 有错误        $.post(yidong.php);这样输出就没有错误  但是达不到效果啊    js 花括号与 smarty 定界符冲突问题,可以这样保护一下js代码不被编译。
{literal}
{/literal}
其实也不必,加个空格就可以
$.post(yidong.php,{ xh :r });
或者换个定界符
使用 {literal} 标记有个坏处:js 代码终究不能有模板变量了
比较好是修改smarty的定界符。
其实也不必,加个空格就可以
$.post(yidong.php,{ xh :r });
或者换个定界符
使用 {literal} 标记有个坏处:js 代码终究不能有模板变量了
加空格不好用啊,   现在上下移动没有动作了  也没办法获取数组   
比较好是修改smarty的定界符。
怎么改啊   换掉大括号么   ?   用{literal}
{/literal}
这样,你试试可以不?
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product