I don't think that will work b/c it will try to parse that HTML as
javascript. You'll need to use a bunch of document.write statements to build
the html from within the js.

Brian

-----Original Message-----
From: James Sleeman [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, February 19, 2002 4:45 PM
To: CF-Talk
Subject: [BH]RE: Dynamic Include


At 10:24 AM 2/20/2002, you wrote:
> > What is the best way to allow someone on another Web server
> > which will not
> > necessarily have CF on it to imbed a call to a CF page on my
> > server. Where
> > my page would do some database lookups and return some HTML
> > that would be
> > imbedded in the original page (not a redirect).
>
>Lee,
>
>You could do this:
>
>  <script src="http://www.yourdomain.com/filename.cfm";></script>
>
>where filename.cfm would use cfcontent to set headers that would trick the
>browser into thinking it was a JavaScript file, and then use valid
>JavaScript in that file to write the content to the screen. It can be a
>chore converting your CF output to valid JavaScript, however.


Wouldn't you just catch all the output of your template (CFSAVECONTENT in
CF5, make a custom tag previously) and use JSStringFormat() to convert to
javascript ?

eg...

<CFSAVECONTENT VARIABLE="TheRealOutput">
         <HTML>
                 <HEAD><TITLE>This Is A Page</TITLE></HEAD>
                 <BODY>
                         Foo Bar Bar Foo
                         Any stuff you want in here, cf stuff, html stuff,
whatever...
                 </BODY>
         </HTML>
</CFSAVECONTENT>
<SCRIPT LANGUAGE="Javascript">
         <CFOUTPUT>document.write("#JsStringFormat(TheRealOutput)#");
</SCRIPT>




James Sleeman
Innovative Media Ltd
Phone: (03) 377 6262
http://www.websolutions.co.nz/

CAUTION: The information contained in this email message is confidential
and may be legally privileged. If the reader of this message is not the
intended recipient you are notified that any use, dissemination,
distribution or reproduction of this message is prohibited. If you have
received this message in error please notify the sender immediately and
destroy the original message and any attachments.

Views expressed in this communication may not be those of Innovative Media
Ltd.

______________________________________________________________________
Dedicated Windows 2000 Server
  PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation · $99/Month · Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to