我在Prototype的Ajax.Request上遇到了一些问题,如果我执行以下操作,请求甚至都不会发出:
<input name="Update" onclick="var req = new Ajax.Request('/agent/reports/update_chart', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this.form), onComplete:function(transport) {alert("TEST");}}); return false;" type="button" value="Update" />
但是,如果我像这样删除onComplete,它将发出这样的请求:
<input name="Update" onclick="var req = new Ajax.Request('/agent/reports/update_chart', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this.form)}); return false;" type="button" value="Update" />
这里我漏掉了什么?我使用的是Prototype 1.5.0。
发布于 2010-12-29 08:32:41
警告(“TEST”)中的双引号会导致HTML语法错误,此处需要使用单引号
发布于 2010-12-29 08:34:01
将alert语句中的双引号替换为单引号。
https://stackoverflow.com/questions/4550595
复制相似问题