Thank you very much. My answer is to your question is either I'm a moron, or subconsciously like to make things much more difficult than they should be.
Thanks. On Feb 25, 1:39 am, "T.J. Crowder" <[email protected]> wrote: > Hi, > > The page you refernced is about adding external script files, which is > why it worked when you did that and not when you tried to do it as an > inline block. > > Why are you trying to use a script tag for this? How 'bout: > > function generateAutoCompleter() > { > new Ajax.Autocompleter( > "oop_description_" + numOopRows, > "oop_autocomplete_choices_" + numOopRows, > "<cfoutput>#CGI.SCRIPT_NAME#</cfoutput>? > event=er.form.item.descriptions", > { > minChars: "3", > paramName: "description_parameter" > } > ); > > } > > HTH, > -- > T.J. Crowder > Independent Software Consultant > tj / crowder software / comwww.crowdersoftware.com > > On Feb 24, 8:25 pm, JJS <[email protected]> wrote: > > > Hello, I'm pretty new to this. Using 1.6.0.3, though tried 1.6.1 and > > it didn't make a difference. Oh, and thanks for a great framework btw. > > > I have a form where I'm generating rows on the fly. One of the form > > fields is using Ajax.autocompleter, so based on this link (http:// > > proto-scripty.wikidot.com/prototype:how-to-load-scripts-dynamically), > > I'm loading the script dynamically. Example: > > > function generateAutoCompleter() > > { > > var head; > > var autoCompleterScript; > > > head = $$('head')[0]; > > if (head) > > { > > autoCompleterScript = new Element('script', { type: 'text/ > > javascript'}); > > $(autoCompleterScript).insert("var > > autocomplete_oop_description_" + > > numOopRows + " = new Ajax.Autocompleter(\"oop_description_" + > > numOopRows + "\", \"oop_autocomplete_choices_" + numOopRows + "\", > > \"<cfoutput>#CGI.SCRIPT_NAME#</cfoutput>? > > event=er.form.item.descriptions\",{minChars:\"3\",paramName: > > \"description_parameter\"});"); > > > head.appendChild(autoCompleterScript); > > } > > > } > > > Note that numOopRows is a global variable that is set elsewhere > > > This works fine in Firefox and Chrome, but IE is giving me Unexpected > > call to method or property access. Looks like the error is occurring > > on line 604 of prototype.js. > > > A couple things - I've tried "chaining a call" using .update when > > creating the element, but that wasn't working in either browser. Is > > there another way to generate the content of the script? > > > One thing that did work in both browsers was to add a src attribute > > pointing to a file with the contents of the js to create the > > autocomplete - however, this is not really an option to me because I > > need to pass the numOopRows variable. > > > Thanks in advance. > > -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
