Files
2012-02-21 01:15:00 -05:00

1 line
2.0 KiB
JSON

[{"user_id": 37659, "stars": [], "topic_id": 45136, "date_created": 1315757072.390275, "message": "I have a rule that emits Javascript which loads other JS, CSS, some HTML via Ajax, etc. The whole process is done with some \"wait\" functions I built to emulate syncronous loading (i.e. don't load \"that\" until \"this\" is loaded). At the very end of the process their is some data coming back from the server which populates some Kynetx vars, which in turn are captured in the 'fired' section of the rule and set on persistent ent: variables.", "group_id": 236, "id": 2101152}, {"user_id": 37659, "stars": [], "topic_id": 45136, "date_created": 1315757164.4830539, "message": "My question is this: can I be sure that 'fired' will not do it's thing until after all my emit logic is complete? I want to be sure that those ent: vars get populated with the correct values from the server", "group_id": 236, "id": 2101162}, {"user_id": 30494, "stars": [], "topic_id": 45136, "date_created": 1315775559.3101809, "message": "Also since your javascript code seems quite complex, I would recommend you to test it inside KBX very early . KBX runs js code in a sandbox so the behaviour might be different then with bookmarklets or standalone extensions.", "group_id": 236, "id": 2103029}, {"user_id": 30494, "stars": [], "topic_id": 45136, "date_created": 1315775450.0186961, "message": "I think \"fired\" runs as soon as your emit logic has been sent to the browser so it might run before the emit logic. @Sam would have to confirm that.", "group_id": 236, "id": 2103010}, {"user_id": 30559, "stars": [], "topic_id": 45136, "date_created": 1316029990.1055241, "message": "I completely agree with Loic's warning. Running javascript in the sandbox is different than running from a bookmark. Fired will not wait until all of the javascript has run. You will need to raise an event from javascript once all your variables are loaded in. In my experience use resource has been the easiest way to load in third party scripts. http://docs.kynetx.com/docs/Use_resource", "group_id": 236, "id": 2128129}]