Microsoft KB Archive/264323

= BUG: Script Encoder Encodes HTML Comments Incorrectly =

Article ID: 264323

Article Last Modified on 5/12/2003

-

APPLIES TO


 * Microsoft Internet Explorer 4.01 Service Pack 1
 * Microsoft Internet Explorer 4.01 Service Pack 2
 * Microsoft Internet Explorer 5.0
 * Microsoft Internet Explorer 5.01
 * Microsoft Internet Explorer (Programming) 5.01 SP1
 * Microsoft Internet Explorer 5.5

-



This article was previously published under Q264323



SYMPTOMS
When you use the command-line script encoder to encode a page, the page does not display exactly as it had before you encoded it.



CAUSE
According to the script encoder documentation, script encoder encodes all of the script after the encoding marker (//**Start Encode**). Unfortunately, this also means that the script encoder encodes the closing comment tag (-->), which is contained within the script block. If the comment tag that encases the script block starts before the encoding marker, the script encoder comments out all of the code until it encounters a closing comment tag.



RESOLUTION
To resolve this problem, remove all of the comment tags that are around script blocks before you run the code through the script encoder.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce Behavior
Save the following HTML page and encode it using the script encoder:   

 

     </HTML><BR/> Your HTML page should display as follows: <HTML>  <SCRIPT language = JScript.Encode>

</STYLE> </HEAD>  <INPUT TYPE=&quot;button&quot; VALUE=&quot;click me&quot; ONCLICK=&quot;btnclick&quot;> </BODY> </HTML> However, the encoded page does not display anything.

<div class="references_section">