这是ajax的代码
$(function(){      $('#core123').mouseover(function(){         var $tip=$('<div id="tip"><div class="t_box"><div><s><i></i></s><img src="temp/images/synonyms/core123.jpg" /></div></div></div>');         $('body').append($tip);         $('#tip').show('fast');      }).mouseout(function(){         $('#tip').remove();      }).mousemove(function(e){         $('#tip').css({"top":(e.pageY-60)+"px","left":(e.pageX+30)+"px"})      })   })  这是页面<div class="td_01_1" style="cursor:pointer;" onClick="load()" id="core123">1345</div>
单独测试没问题  ,通过网站运行就有问题:报错
Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "../templates\tongyici/index.html" on line 88 "$('#tip').css({&quot;top&quot;:(e.pageY-60)+&quot;px&quot;,&quot;left&quot;:(e.pageX+30)+&quot;px&quot;})" - Unexpected ":", expected one of: "}" , " "' in D:\AMP\thirdHost\petdog2\smarty\sysplugins\smarty_internal_templatecompilerbase.php:441 Stack trace: #0 D:\AMP\thirdHost\petdog2\smarty\sysplugins\smarty_internal_templateparser.php(2889): Smarty_Internal_TemplateCompilerBase->trigger_template_error() #1 D:\AMP\thirdHost\petdog2\smarty\sysplugins\smarty_internal_templateparser.php(2954): Smarty_Internal_Templateparser->yy_syntax_error(2, ':') #2 D:\AMP\thirdHost\petdog2\smarty\sysplugins\smarty_internal_smartytemplatecompiler.php(51): Smarty_Internal_Templateparser->doParse(2, ':') #3 D:\AMP\thirdHost\petdog2\smarty\sysplugins\smarty_internal_templatecompilerbase.php(82): Smarty_Internal_SmartyTemplateCompiler->doCompile('<!DOCTYPE html ...') #4 D:\AMP\thirdHost\petdog2\smart in D:\AMP\thirdHost\petdog2\smarty\sysplugins\smarty_internal_templatecompilerbase.php on line 441
求解,大侠

解决方案 »

  1.   

    你smarty的边界符是什么  是不是冲突了
      

  2.   

    楼主你的smarty边界符是不是“{}”啊
      

  3.   

    我修改了smarty left_limiter right_limiter,但是不起作用,我不想在配置里改smarty边界符,因为改得很多。所以
    $('#tip').css({"top":(e.pageY-60)+"px","left":(e.pageX+30)+"px"}) 这句能不能变换掉
      

  4.   

    如果没有设置 默认是 {} 这样子 要么你的js包装成一个js文件 用src引用 要么为你的js代码加上
    {literal}
     script
    {/literal}
    标签
      

  5.   

    尝试改成这样
    $('#tip').css({ "top":(e.pageY-60)+"px","left":(e.pageX+30)+"px" })
      

  6.   

    大哥出马,果然不同凡响,heyli的方法也很强大,妖言的建议很受启示。