response.appendContentString("function " + id + "Update() { new Ajax.Updater('" + id + "', $(" + id + ").updateUrl, ");
response.appendContentString("function " + id + "Update() { new Ajax.Updater('" + id + "', $(" + id + ").getAttribute('updateUrl'), ");
    public void appendToResponse(WOResponse response, WOContext context) {      super.appendToResponse(response, context);      String id = containerID();            NSDictionary options = createAjaxOptions();            response.appendContentString("<script type = \"text/javascript\" language = \"javascript\"><!--\n");      if (canGetValueForBinding("frequency")) {        response.appendContentString("new Ajax.PeriodicalUpdater('" + id + "', $(" + id + ").updateUrl, ");        AjaxOptions.appendToResponse(options, response, context);        response.appendContentString(");");      }            if (canGetValueForBinding("observeFieldID")) {        String observeFieldID = (String)valueForBinding("observeFieldID");        response.appendContentString("new Form.Element.Observer($('" + observeFieldID + "'), 1, function(element, value) {");        NSMutableDictionary observerOptions = new NSMutableDictionary();        observerOptions.setObjectForKey("true", "asynchronous");                // We need to cheat and make the WOForm that contains the form action appear to have been        // submitted.  So we grab the action url, pull off the element ID from its action URL        // and pass that in as FORCE_FORM_SUBMITTED_KEY, which is processed by ERXWOForm just like        // senderID is on the real WOForm.  Unfortunately we can't hook into the real WOForm to do        // this :(        response.appendContentString("var formAction = $('" + observeFieldID + "').form.action;");        response.appendContentString("var senderID = formAction.substring(formAction.indexOf('.', formAction.lastIndexOf('/')) + 1);");        StringBuffer parameters = new StringBuffer();        parameters.append("escape($('" + observeFieldID + "').name) + '=' + escape($('" + observeFieldID + "').value) + '");        parameters.append("&");        parameters.append(AjaxUtils.FORCE_FORM_SUBMITTED_KEY + "=' + senderID + '");        parameters.append("'");                observerOptions.setObjectForKey(parameters.toString(), "parameters");        response.appendContentString("new Ajax.Updater('" + id + "', $('" + id + "').updateUrl, ");        AjaxOptions.appendToResponse(observerOptions, response, context);        response.appendContentString(") });");      }      response.appendContentString("function " + id + "Update() { new Ajax.Updater('" + id + "', $(" + id + ").updateUrl, ");      AjaxOptions.appendToResponse(options, response, context);      response.appendContentString("); }");            response.appendContentString("//--></script>");    }