I used the scriptaculous autocomplete to create a big page of editable fields, the amount of fields is dynamic, and therefore i create an array to hold all of the autocomplete objects.
then, i need to allow the user to add a field in every place of the page, so, i create a javascript function that redo the sequences of the text fields, and recreate all autocomplete's.
but there is a problem, that the old autocomplete's also appear on the page, and even if a make the array to length of zero, the old autocomplete's are hare.
Is there a way to delete completely a prototype object?
You need at least clear references stored in autocompleter object:
autocompleter.element = null;
autocompleter.update = null;
要删除DOM引用,您可以
bigAutoCompleteObject = null;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.