0

我的问题与类似- 如何获得 javascript this(这样我可以在假设它是表单文本输入的情况下获得它的值)?我正在尝试将文本输入的值发送到您看到的回调:

html textInput id: #thingy; 
 onClick: (html jQuery ajax 
  callback:[:x | x inspect]
  value:(html jQuery event currentTarget ????));
   with: 'I am the value the poster wants to see inspected in the above callback block!'.
4

2 回答 2

1

如果您想在单击时触发回调,只需在 onClick 事件上绑定 serializeThisWithHidden。

html textInput id: #thingy; 
 onClick: (html jQuery ajax serializeThisWithHidden);
  callback:[:x | x inspect];
  with: 'I am the value the poster wants to see inspected in the above callback block!'.

意料之外 :)

于 2011-01-18T09:43:21.067 回答
1

要获取 ajax 回调中的值,您将使用

html textInput id: #thingy; 
        onClick: (html jQuery ajax 
        callback:[:x | x inspect] value: html jQuery new value);
        with: 'I am the value the poster wants to see inspected in the above callback block!'.
于 2011-01-19T07:40:00.027 回答