Use single quotes in the alert() or use a custom tag to implement CFHTMLHEAD the way 
it should have been done:

<cfif thistag.ExecutionMode IS "end">
        <cfhtmlhead text="#thistag.GeneratedContent#">
        <cfset thistag.GeneratedContent = "">
</cfif>

Save this in a file called htmlhead.cfm and change your code to:

<cf_htmlhead>
          <script>
          <!-- Hide the script from old browsers --
          function loadalert ()
              {alert("Your Message to Mike was sent.")
          }
          // --End Hiding Here -->
          </script>
</cf_htmlhead>

Then you don't need to worry about the quotes.

Craig

> -----Original Message-----
> From: Brian Thornton [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, March 27, 2001 3:22 PM
> To:   CF-Talk
> Subject:      CFHTMLHEAD
> 
>   <CFHTMLHEAD TEXT="
>   <script>
>   <!-- Hide the script from old browsers --
>   function loadalert ()
>       {alert("Your Message to Mike was sent.")
>   }
>   // --End Hiding Here -->
>   </script>
>   ">
> 
> I get the error "Just in time compilation error
> 
> An unknown attribute 'Your' has been encountered at document position
> (22:15) to (22:18) while processing tag CFHTMLHEAD. This tag can only take
> the following attributes:
> 
> TEXT
> The last successfully parsed CFML construct was a CFHTMLHEAD tag occupying
> document position (18:3) to (18:13)."
> 
> If I remove the quotes from ("Your Message to Mike was sent.") It's fine but
> the the alert doesn't happen....
> 
> Any ideas I tread &quot;
> 
> 
> 
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to