code: public static void writeHtmlImagePreloadJavaScript(String url, Appendable out) throws IOException {
  		out.append("<script type='text/javascript'>\n"
  				+ "  var img=new Image();\n"
  				+ "  img.src=\"");
  		// Escape for javascript
  		StringBuilder javascript = new StringBuilder(url.length());
  		encodeTextInJavaScript(url, javascript);
  		// Encode for XML attribute
  		encodeJavaScriptInXhtmlAttribute(javascript, out);
  		out.append("\";\n"
  				+ "</script>");
  	}
docs: Prints a JavaScript script that will preload the image at the provided URL.
  
  @param url This should be the URL-encoded URL, but with only a standalone ampersand (&amp;) as parameter separator
  (not &amp;amp;)