[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]
Simon Waters wrote: > tom wrote: > >> http://www.100297.itsosbroadband.co.uk/play/simplelist.html >> >> will fail >> take a copy of the file and do as above it will work! >> OR add another button that calls addItem and the other one works??? >> > > The above fails in Iceweasel 3.0.6, I believe the issue stems from the > INPUT element name colliding with the function name. > > In the DOM INPUT element name define a Javascript array, elements with > the same name making additional entries in the array. > > So in the example 'name="AddItem"' defines the array AddItem in scope, > overriding the function with the same name, hence the error "no such > function". > > I can't explain everything you are seeing, but I think this probably > helps explain where the confusion starts, you'll figure the rest out I'm > sure. > > All very inelegant, but then one of Javascript's main problems is the > environment in which it finds itself. > > Not an issue I've seen before, but (nearly) all our JavaScript at work > is stuck in various namespaces to avoid namespace conflicts like this one. > > Well spotted - I keep forgetting this one! Given that it knows its looking for a function it would be nice if the language actually looked for a function of that name! Thanks for reminding me of the namespace 'cheat', now to get on with my automate everything code.... Tom te tom te tom -- The Mailing List for the Devon & Cornwall LUG http://mailman.dclug.org.uk/listinfo/list FAQ: http://www.dcglug.org.uk/linux_adm/list-faq.html