Copy link to clipboard
Copied
I have a plain html file, content of which are dynamically generated (on accessing it) over a few seconds (about 7-10 second) like some tables, rows of which are added through javascript after doing some processing and this process takes about said 7-10 seconds.
Using settimeout(), after 15 seconds (to ensure that content has been populated correctly), I am running a web service (.cfc with function having cfmail tag in it) through javascript ajax call which captures all html content of page and sends to marked email ids – which in normal course works fine – when page is accessed in web browser and left open for desired time of about 15-20 seconds.
However, the same page when I schedule in CF admin (even with timeout of 60 second), it never fires the sending email part.
Can I have some advise, where I am doing wrong!
1 Correct answer
Hi, finally the scheduled activity could be accomplished using native heavyweight cf codes instead of lightweight and fast javascript codes. Not a big deal anyway.
Copy link to clipboard
Copied
Hmm, the CF scheduler calls CF templates and does not run client-side code like a normal web browser would, as far as I am aware. You need to do the same thing with CF code only, and not using JavaScript. You can use CFHTTP to grab content from other URLs. If you could make your script work in CF only, it would then work in both cases.
Copy link to clipboard
Copied
Thanks tribule. It worked as described !
Copy link to clipboard
Copied
Yes, that what I said. I like it how you award the correct answer to yourself lol.
Copy link to clipboard
Copied
Hi, finally the scheduled activity could be accomplished using native heavyweight cf codes instead of lightweight and fast javascript codes. Not a big deal anyway.

