Returns a local resource properly encoded as a JavaScript string including the quote characters.