Coldfusion Scheduled Task for HTML files with javascript ajax call to web service

Community Beginner ,
Oct 03, 2015 Oct 03, 2015

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!

Views

581

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct Answer

Community Beginner , Oct 08, 2015 Oct 08, 2015
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.

Likes

Translate

Translate
Enthusiast ,
Oct 05, 2015 Oct 05, 2015

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 08, 2015 Oct 08, 2015

Copy link to clipboard

Copied

Thanks tribule. It worked as described !

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Oct 10, 2015 Oct 10, 2015

Copy link to clipboard

Copied

LATEST

Yes, that what I said. I like it how you award the correct answer to yourself lol.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Oct 08, 2015 Oct 08, 2015

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.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines