Skip to main content
Participating Frequently
March 22, 2008
Question

Delay execution of CFML

  • March 22, 2008
  • 3 replies
  • 537 views
Hi there

I manage a site that "pre-generates" pages, so that the execution time is quicker and the demands on the server are reduced when users come to the site.

The problem is this. I have a template that contains CFML that looks to see the browser that the user is using. When the pages are "pregenerated" using say IE and the user visits using Firefox, the pages to not render properly, because the pregeneration process inserts a reference to the stylesheet for IE, and not Firefox (which makes sense).

I would simply like to "include" the code that determines which stylesheet should be used in the pregenerated page so that it is executed when the user visists the site, rather than the pregenerated page executing that code when the page is created.

Is anyone able to assist?

Thanks for your help in advance.

Goofy

This topic has been closed for replies.

3 replies

Participating Frequently
March 25, 2008
If the design based on CSS, there would be a solution also in CSS level.

Such as ...

<link rel="stylesheet" href="styles.css" />
<!--[if lt IE 7]>
<link rel="stylesheet" href="ie7.css" />
<![endif]-->
BKBK
Community Expert
Community Expert
March 25, 2008
You could proceed as follows:

BKBK
Community Expert
Community Expert
March 24, 2008
It's not quite clear to me what the problem is. From what I can guess, you could solve the problem by adding code to choose the style in Application.cfm or Application.cfc, thus

Participating Frequently
March 24, 2008
Thanks very much for your response.

The problem is, my CF code (similar to that which you have set out below) executes when I pregenerate my page. So, if I were pregenerating the pages using (say) IE7, the line of code "<LINK href="ie7_style.css" rel="stylesheet" type="text/css">" would be inserted into the page, which would then be live on the website. If a person comes along and views the page using Firefox, Opera, IE6 or any other broswer, the IE7 css will be used, because the line <LINK href="ie7_style.css" rel="stylesheet" type="text/css"> is already in the template.

What I want to do is insert the code (such as yours below) into the template that server executes when the Firefox (or other) user comes to the site.

Does this assist?

Regards

Goofy