> Here's my current iteration, which creates the javascript, but still doesn't 
> show on the
> http://www.photoeye.com/advertising/test_ad.cfm
>
> <cfsavecontent variable="text"><cfoutput><a 
> href=#qGetCurrentAdLink.link_url#><img
> src=http://www.photoeye.com/magazine/ads/#qGetAd.image_filename#></a></cfoutput></cfsavecontent>
> <!--- Genarate the javascript text --->
> <cfset text = jsStringFormat(text)>
>
> <cfoutput>#text#</cfoutput>
>
> <!--- Stream the javascript back to the caller  --->
>
> <CFContent Type = "application/javascript"   reset="yes">
>        <cfoutput>
>        document.write('#text#');
>        </cfoutput>

OK. Looking at your site it looks like you've fixed this already - I'm
getting what looks correct in Chrome and IE 8.

That said, here's how I'd change your script:

<cfsetting showdebugoutput="no">

<cfcontent type="application/javascript"
reset="yes"><cfoutput>document.write('<a
href="#qGetCurrentAdLink.link_url#"><img
src="http://www.photoeye.com/magazine/ads/#qGetAd.image_filename#";></a>');</cfoutput>

You don't need the CFSAVECONTENT, or the first CFOUTPUT, or the second
CFOUTPUT. Because you're taking values out of your database that
presumably correspond to valid URLs, you don't even really need the
JSStringFormat, although if you want it you could wrap it around each
of the output values above. Finally, you don't really want any extra
whitespace once you start to output the non-HTML stuff, so your
CFCONTENT, CFOUTPUT, and the output itself should all be on one line -
it won't make a difference here, but will make a difference if you're
trying to output, say, RTF.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
http://training.figleaf.com/

Fig Leaf Software is a Veteran-Owned Small Business (VOSB) on
GSA Schedule, and provides the highest caliber vendor-authorized
instruction at our training centers, onli

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology-Michael-Dinowitz/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:337545
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to