Issue: when building an html file and attempting t...
# suitescript
e
Issue: when building an html file and attempting to write the contents to the browser in a Suitelet, I get errors due to Netsuite appending a comment to the end of the html outside of the closing body tag. How to prevent NS from appending?
scriptContext.response.write(tmpFile.getContents());
The file itself I inspected, and it is pure html. Last line of the file:
Copy code
</body>
the response however, includes the following tag:
Copy code
</body><!-- 5,369 s: 65% #551 cache: 1% #62 -->
<!-- Host [ a237.prod.phx.na7.core.ns.internal ] App Version [ 2022.2.14.30573 ] -->
<!-- COMPID [ removed ]  EMAIL [ removed ] URL [ /app/site/hosting/scriptlet.nl ] Time [ Fri Dec 02 09:49:23 PST 2022 ] -->
<!-- Not logging slowest SQL -->
s
Not sure how complex your suitelet is but you might consider taking things more under your own control by building a small app instead
e
i think i solved this; i was setting the Content-Header and writing the file contents as mentioned; instead, I skip the header and call
response.writeFile
instead
thanks @Shawn Talbert
s
writeFile
is probably a pretty clever way to avoid it, since it appears NS doesn't make additional assumptions like it was doing for the HTML output you had prior.
e
👍