> > > 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>

That'll work, as long as you lose those <script> tags (the calling HTML
page is already expecting JavaScript), and add the proper CFContent tags
to set the MIME headers correctly for JavaScript.

There are other nuances our CF_MakeFuselet tag takes care of, particularly
the handling of URL variables back and forth to the calling page, but you
don't need that if all you're doing is showing static content and not an
application.

-Ron

______________________________________________________________________
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