During some recent development, I figured I would flex FW’s environment to better suit my needs by adding some Object methods that I thought would be useful to me, like String.unQuote(). I also figured that the JS environment was discrete to each Action; after all, a crash in one Action does not hinder other Actions from publishing.
Upon testing, and just by coincidence as I usually test with just the single Action so as to only see its output, I had another Action applied to the page. During publish I had an alert message pop up that caused me some consternation trying to figure out its source. I must have dug through my code two or three times looking for the alert. Come to find out the alert was from that other action; triggered by a ‘for(var i in XXX)’ loop.
The moral: Don’t alter/create ‘prototypes’. FW does a decent job of keeping Actions segregated, but the JS engine is apparently generated once and reused for all Actions on that page. Any alterations made by one Action will be seen (and felt!) by all others.
Fortunately, it was early in development and not much time was invested in utilizing any of these methods yet.
Lesson learned.
actionsdev mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options